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
graph_analysis::GraphId
uint32_t GraphId
Definition: GraphElement.hpp:22
graph_analysis::BaseGraphObserver::notify
virtual void notify(const Vertex::Ptr &vertex, const EventType &event, const GraphId &origin)
Definition: BaseGraphObserver.hpp:43
graph_analysis::TRANSACTION_START
@ TRANSACTION_START
Definition: BaseGraphObserver.hpp:29
Vertex.hpp
graph_analysis::BaseGraphObserver::Ptr
shared_ptr< BaseGraphObserver > Ptr
Definition: BaseGraphObserver.hpp:39
graph_analysis
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
graph_analysis::Edge::Ptr
shared_ptr< Edge > Ptr
Definition: Edge.hpp:21
Edge.hpp
graph_analysis::BaseGraphObserver::notify
virtual void notify(const Edge::Ptr &edge, const EventType &event, const GraphId &origin)
Definition: BaseGraphObserver.hpp:49
graph_analysis::EVENT_TYPE_ADDED
@ EVENT_TYPE_ADDED
Definition: BaseGraphObserver.hpp:17
graph_analysis::Vertex::Ptr
shared_ptr< Vertex > Ptr
Definition: Vertex.hpp:22
graph_analysis::BaseGraphObserver::notify
virtual void notify(const TransactionType &event, const GraphId &origin)
Definition: BaseGraphObserver.hpp:55
graph_analysis::TRANSACTION_STOP
@ TRANSACTION_STOP
Definition: BaseGraphObserver.hpp:30
graph_analysis::EVENT_TYPE_REMOVED
@ EVENT_TYPE_REMOVED
Definition: BaseGraphObserver.hpp:18
graph_analysis::TransactionType
TransactionType
Transaction events These events are triggers for the notification system to allow transactions to be ...
Definition: BaseGraphObserver.hpp:27
graph_analysis::BaseGraphObserver::~BaseGraphObserver
virtual ~BaseGraphObserver()
Definition: BaseGraphObserver.hpp:41
graph_analysis::EventType
EventType
Types of events for the observer. Example: notify(vertex, EVENT_TYPE_ADDED, ...) is called whenever a...
Definition: BaseGraphObserver.hpp:15
graph_analysis::BaseGraphObserver
Virtual interface class for observing a base graph.
Definition: BaseGraphObserver.hpp:36