17 #ifndef DURABILITY_GRAPH_HPP 18 #define DURABILITY_GRAPH_HPP 22 #include <boost/graph/graph_traits.hpp> 23 #include <boost/graph/adjacency_list.hpp> 24 #include <boost/graph/graphviz.hpp> 52 typedef boost::adjacency_list<
55 boost::bidirectionalS ,
58 typedef boost::graph_traits<DirectedGraph>::vertex_descriptor
VDesc;
59 typedef boost::graph_traits<DirectedGraph>::edge_descriptor
EDesc;
60 typedef boost::graph_traits<DirectedGraph>::vertex_iterator
VIter;
61 typedef boost::graph_traits<DirectedGraph>::in_edge_iterator
IEIter;
68 : NodeId_(nid), NodeType_(node_type) {}
77 boost::graph_traits<DirectedGraph>::vertices_size_type
79 {
return boost::num_vertices(DirectedGraph_); }
82 { DirectedGraph_[vertex].isStable_ = b; }
84 {
return DirectedGraph_[vertex].isStable_; }
93 {
return DirectedGraph_; }
96 { boost::clear_vertex(vertex, DirectedGraph_); }
98 { boost::remove_vertex(vertex, DirectedGraph_); }
101 {
return DirectedGraph_[vertex].Fase_; }
109 DirectedGraph DirectedGraph_;
110 NodeInfoMap NodeInfoMap_;
117 void PrintBeginDurableLog(
LogEntry *le);
119 void PrintRWUnlockLog(
LogEntry *le);
120 void PrintEndDurableLog(
LogEntry *le);
133 return boost::add_vertex(
VProp(fase,
true ),
141 std::pair<EDesc, bool> edge_pair =
142 boost::add_edge(src, tgt, DirectedGraph_);
143 return edge_pair.first;
bool is_stable(VDesc vertex) const
Definition: durability_graph.hpp:83
void set_is_stable(VDesc vertex, bool b)
Definition: durability_graph.hpp:81
boost::graph_traits< DirectedGraph >::vertex_descriptor VDesc
Definition: durability_graph.hpp:58
std::map< LogEntry *, NodeInfo > NodeInfoMap
Definition: durability_graph.hpp:75
boost::graph_traits< DirectedGraph >::vertices_size_type get_num_vertices() const
Definition: durability_graph.hpp:78
FASection * Fase_
Definition: durability_graph.hpp:48
const DirectedGraph & get_directed_graph() const
Definition: durability_graph.hpp:92
Definition: log_structure.hpp:30
bool isStable_
Definition: durability_graph.hpp:49
boost::graph_traits< DirectedGraph >::in_edge_iterator IEIter
Definition: durability_graph.hpp:61
Definition: durability_graph.hpp:66
void remove_vertex(VDesc vertex)
Definition: durability_graph.hpp:97
static Helper & getInstance()
Definition: helper.hpp:66
void trace(T s)
Definition: helper.hpp:78
Definition: durability_graph.hpp:64
VDesc createNode(FASection *fase)
Definition: durability_graph.hpp:128
EDesc createEdge(VDesc src, VDesc tgt)
Definition: durability_graph.hpp:137
boost::graph_traits< DirectedGraph >::edge_descriptor EDesc
Definition: durability_graph.hpp:59
boost::graph_traits< DirectedGraph >::vertex_iterator VIter
Definition: durability_graph.hpp:60
NodeInfo(VDesc nid, NodeType node_type)
Definition: durability_graph.hpp:67
Definition: durability_graph.hpp:43
void traceHelper(T tt)
Definition: durability_graph.hpp:104
VDesc NodeId_
Definition: durability_graph.hpp:71
NodeType
Definition: durability_graph.hpp:64
NodeInfo getTargetNodeInfo(LogEntry *tgt_le)
Definition: durability_graph_builder.cpp:195
Definition: durability_graph.hpp:64
boost::adjacency_list< boost::setS, boost::listS, boost::bidirectionalS, VProp > DirectedGraph
Definition: durability_graph.hpp:56
void trace()
Definition: durability_graph_builder.cpp:215
NodeType NodeType_
Definition: durability_graph.hpp:72
Definition: atlas_alloc_cpp.hpp:21
void addToNodeInfoMap(LogEntry *le, VDesc nid, NodeType nt)
Definition: durability_graph_builder.cpp:206
FASection * get_fase(VDesc vertex) const
Definition: durability_graph.hpp:100
VProp(FASection *fase, bool is_stable)
Definition: durability_graph.hpp:44
void clear_vertex(VDesc vertex)
Definition: durability_graph.hpp:95
Definition: durability_graph.hpp:35