00001 // Galois Managed Conflict type wrapper -*- C++ -*- 00002 /* 00003 Galois, a framework to exploit amorphous data-parallelism in irregular 00004 programs. 00005 00006 Copyright (C) 2011, The University of Texas at Austin. All rights reserved. 00007 UNIVERSITY EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING THIS SOFTWARE 00008 AND DOCUMENTATION, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR ANY 00009 PARTICULAR PURPOSE, NON-INFRINGEMENT AND WARRANTIES OF PERFORMANCE, AND ANY 00010 WARRANTY THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF TRADE. 00011 NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO THE USE OF THE 00012 SOFTWARE OR DOCUMENTATION. Under no circumstances shall University be liable 00013 for incidental, special, indirect, direct or consequential damages or loss of 00014 profits, interruption of business, or related expenses which may arise from use 00015 of Software or Documentation, including but not limited to those resulting from 00016 defects in Software and/or Documentation, or loss or inaccuracy of data of any 00017 kind. 00018 */ 00019 00020 #ifndef _GALOIS_UTIL_CONFLICTCHECK_H 00021 #define _GALOIS_UTIL_CONFLICTCHECK_H 00022 00023 #include "Galois/Runtime/Context.h" 00024 00025 namespace Galois { 00026 00028 00030 template<typename T> 00031 class GChecked : public GaloisRuntime::Lockable { 00032 T val; 00033 00034 public: 00035 GChecked(const T& v) :val(v) {} 00036 00037 T& get(Galois::Graph::MethodFlag m = ALL) const 00038 { 00039 GaloisRuntime::acquire(this, m); 00040 return val; 00041 } 00042 }; 00043 00044 } 00045 00046 00047 00048 #endif // _GALOIS_UTIL_CONFLICTCHECK_H