graph_analysis
BaseGraphObserver.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_BASE_GRAPH_OBSERVER_HPP
2 #define GRAPH_ANALYSIS_BASE_GRAPH_OBSERVER_HPP
3 
4 #include "Edge.hpp"
5 #include "Vertex.hpp"
6 
7 namespace graph_analysis
8 {
9 
16 {
19 };
20 
28 {
31 };
32 
37 {
38 public:
39  typedef shared_ptr<BaseGraphObserver> Ptr;
40 
41  virtual ~BaseGraphObserver() {}
42 
43  virtual void notify(const Vertex::Ptr& vertex, const EventType& event,
44  const GraphId& origin)
45  {
46  throw std::runtime_error(
47  "BaseGraphObserver::notify(Vertex) not implemented");
48  };
49  virtual void notify(const Edge::Ptr& edge, const EventType& event,
50  const GraphId& origin)
51  {
52  throw std::runtime_error(
53  "BaseGraphObserver::notify(Edge) not implemented");
54  };
55  virtual void notify( const TransactionType& event, const GraphId& origin )
56  {
57  // does not need to throw if not implemented
58  // this is also to keep backwards compatibility
59  };
60 };
61 }
62 #endif
virtual void notify(const Vertex::Ptr &vertex, const EventType &event, const GraphId &origin)
Definition: BaseGraphObserver.hpp:43
shared_ptr< BaseGraphObserver > Ptr
Definition: BaseGraphObserver.hpp:39
Definition: BaseGraphObserver.hpp:17
shared_ptr< Edge > Ptr
Definition: Edge.hpp:21
Definition: BaseGraphObserver.hpp:18
TransactionType
Transaction events These events are triggers for the notification system to allow transactions to be ...
Definition: BaseGraphObserver.hpp:27
virtual void notify(const TransactionType &event, const GraphId &origin)
Definition: BaseGraphObserver.hpp:55
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
shared_ptr< Vertex > Ptr
Definition: Vertex.hpp:22
virtual void notify(const Edge::Ptr &edge, const EventType &event, const GraphId &origin)
Definition: BaseGraphObserver.hpp:49
Virtual interface class for observing a base graph.
Definition: BaseGraphObserver.hpp:36
virtual ~BaseGraphObserver()
Definition: BaseGraphObserver.hpp:41
Definition: BaseGraphObserver.hpp:29
EventType
Types of events for the observer. Example: notify(vertex, EVENT_TYPE_ADDED, ...) is called whenever a...
Definition: BaseGraphObserver.hpp:15
Definition: BaseGraphObserver.hpp:30
uint32_t GraphId
Definition: GraphElement.hpp:22