20 #ifndef GALOIS_GRAPHS_LC_ADAPTOR_GRAPH_H
21 #define GALOIS_GRAPHS_LC_ADAPTOR_GRAPH_H
23 #include "galois/config.h"
30 template <
typename NodeTy,
typename EdgeTy,
typename DerivedTy,
31 typename GraphNodeTy,
typename IteratorTy,
typename EdgeIteratorTy,
32 bool HasNoLockable =
false>
34 :
private internal::OutOfLineLockableFeature<HasNoLockable>,
35 private internal::LocalIteratorFeature<false> {
38 template <
bool _has_no_lockable>
41 EdgeIteratorTy, _has_no_lockable>
50 typedef typename internal::NodeInfoBase<NodeTy, false>::reference
58 template <
bool _A1 = HasNoLockable>
60 typename std::enable_if<!_A1>::type* = 0) {
61 this->outOfLineAcquire(
getId(N), mflag);
64 template <
bool _A1 = HasNoLockable>
66 typename std::enable_if<_A1>::type* = 0) {}
69 return *
static_cast<const DerivedTy*
>(
this);
72 DerivedTy&
derived() {
return *
static_cast<DerivedTy*
>(
this); }
88 return derived().get_edge_data(ni);
107 ee =
derived().get_edge_end(N);
112 return derived().get_edge_begin(N);
117 return derived().get_edge_end(N);
120 internal::EdgesIterator<LC_Adaptor_Graph>
122 return internal::EdgesIterator<LC_Adaptor_Graph>(*
this, N, mflag);
internal::EdgeInfoBase< void *, EdgeTy >::reference edge_data_reference
Definition: LC_Adaptor_Graph.h:49
internal::NodeInfoBase< NodeTy, false >::reference node_data_reference
Definition: LC_Adaptor_Graph.h:51
iterator const_iterator
Definition: LC_Adaptor_Graph.h:54
DerivedTy & derived()
Definition: LC_Adaptor_Graph.h:72
EdgeIteratorTy edge_iterator
Definition: LC_Adaptor_Graph.h:52
node_data_reference getData(GraphNode N, MethodFlag mflag=MethodFlag::WRITE)
Definition: LC_Adaptor_Graph.h:77
Definition: LC_Adaptor_Graph.h:33
LC_Adaptor_Graph< NodeTy, EdgeTy, DerivedTy, GraphNodeTy, IteratorTy, EdgeIteratorTy, _has_no_lockable > type
Definition: LC_Adaptor_Graph.h:42
void acquireNode(GraphNode N, MethodFlag mflag, typename std::enable_if<!_A1 >::type *=0)
Definition: LC_Adaptor_Graph.h:59
edge_data_reference getEdgeData(edge_iterator ni, MethodFlag GALOIS_UNUSED(mflag)=MethodFlag::UNPROTECTED)
Definition: LC_Adaptor_Graph.h:85
bool shouldLock(const galois::MethodFlag g)
Helper function to decide if the conflict detection lock should be taken.
Definition: libgalois/include/galois/runtime/Context.h:189
EdgeTy & reference
Definition: LazyObject.h:96
iterator begin() const
Definition: LC_Adaptor_Graph.h:96
uint64_t sizeEdges() const
Definition: LC_Adaptor_Graph.h:94
NodeTy node_data_type
Definition: LC_Adaptor_Graph.h:47
iterator end() const
Definition: LC_Adaptor_Graph.h:97
If true, do not use abstract locks in graph.
Definition: LC_Adaptor_Graph.h:39
MethodFlag
What should the runtime do when executing a method.
Definition: MethodFlags.h:34
IteratorTy iterator
Definition: LC_Adaptor_Graph.h:53
void acquireNode(GraphNode, MethodFlag, typename std::enable_if< _A1 >::type *=0)
Definition: LC_Adaptor_Graph.h:65
const DerivedTy & derived() const
Definition: LC_Adaptor_Graph.h:68
edge_iterator edge_begin(GraphNode N, MethodFlag mflag=MethodFlag::WRITE)
Definition: LC_Adaptor_Graph.h:103
GraphNode getEdgeDst(edge_iterator ni)
Definition: LC_Adaptor_Graph.h:91
internal::EdgesIterator< LC_Adaptor_Graph > out_edges(GraphNode N, MethodFlag mflag=MethodFlag::WRITE)
Definition: LC_Adaptor_Graph.h:121
iterator local_iterator
Definition: LC_Adaptor_Graph.h:55
uint64_t size() const
Definition: LC_Adaptor_Graph.h:93
local_iterator local_end()
Definition: LC_Adaptor_Graph.h:101
GraphNodeTy GraphNode
Definition: LC_Adaptor_Graph.h:45
size_t getId(GraphNode n)
Definition: LC_Adaptor_Graph.h:74
edge_iterator edge_end(GraphNode N, MethodFlag mflag=MethodFlag::WRITE)
Definition: LC_Adaptor_Graph.h:115
local_iterator local_begin()
Definition: LC_Adaptor_Graph.h:98
EdgeTy edge_data_type
Definition: LC_Adaptor_Graph.h:46