00001 00026 #ifndef GALOIS_WORKLIST_EXTERNREF_H 00027 #define GALOIS_WORKLIST_EXTERNREF_H 00028 00029 namespace Galois { 00030 namespace WorkList { 00031 00032 template<typename Container, bool pushinit = true> 00033 struct ExternRef { 00035 template<bool _concurrent> 00036 struct rethread { typedef ExternRef<typename Container::template rethread<_concurrent>::type> type; }; 00037 00039 template<typename _T> 00040 struct retype { typedef ExternRef<typename Container::template retype<_T>::type> type; }; 00041 00042 private: 00043 Container& wl; 00044 00045 public: 00046 ExternRef(Container& _wl) :wl(_wl) {} 00047 00049 typedef typename Container::value_type value_type; 00050 00052 void push(const value_type& val) { wl.push(val); } 00053 00055 template<typename Iter> 00056 void push(Iter b, Iter e) { wl.push(b,e); } 00057 00060 template<typename RangeTy> 00061 void push_initial(const RangeTy& r) { if (pushinit) wl.push_initial(r); } 00062 00064 Galois::optional<value_type> pop() { return wl.pop(); } 00065 }; 00066 00067 } 00068 } 00069 #endif