All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GraphEventProxy.h
Go to the documentation of this file.
1 /*
2  * GraphEventProxy.h
3  *
4  * Created on: 03.04.2013
5  * Author: cls
6  */
7 
8 #ifndef GRAPHEVENTPROXY_H_
9 #define GRAPHEVENTPROXY_H_
10 
11 #include "../graph/Graph.h"
12 #include "GraphEventHandler.h"
13 
14 namespace NetworKit {
15 
23 
24 protected:
25 
26  std::vector<GraphEventHandler*> observers;
27 
28 
29 public:
30 
31  Graph* G;
32 
33  GraphEventProxy(); // nullary constructor needed for python interface
34 
36 
37  void registerObserver(GraphEventHandler* observer);
38 
39  node addNode();
40 
41  void removeNode(node u);
42 
43  void restoreNode(node u);
44 
45  void addEdge(node u, node v, edgeweight weight = defaultEdgeWeight);
46 
47  void removeEdge(node u, node v);
48 
49  void setWeight(node u, node v, edgeweight w);
50 
51  void incrementWeight(node u, node v, edgeweight delta);
52 
53  void timeStep();
54 };
55 
56 } /* namespace NetworKit */
57 #endif /* GRAPHEVENTPROXY_H_ */
This class enables the observer pattern for dynamic graphs: It has the same modifiers as a Graph obje...
Definition: GraphEventProxy.h:22
void removeNode(node u)
Definition: GraphEventProxy.cpp:29
Definition: GraphEventHandler.h:18
void restoreNode(node u)
Definition: GraphEventProxy.cpp:37
node addNode()
Definition: GraphEventProxy.cpp:20
GraphEventProxy()
Definition: GraphEventProxy.cpp:13
void registerObserver(GraphEventHandler *observer)
Definition: GraphEventProxy.cpp:88
void timeStep()
Definition: GraphEventProxy.cpp:79
void addEdge(node u, node v, edgeweight weight=defaultEdgeWeight)
Definition: GraphEventProxy.cpp:44
void removeEdge(node u, node v)
Definition: GraphEventProxy.cpp:52
void incrementWeight(node u, node v, edgeweight delta)
Definition: GraphEventProxy.cpp:70
index node
Definition: Globals.h:23
std::vector< GraphEventHandler * > observers
Definition: GraphEventProxy.h:26
Graph * G
Definition: GraphEventProxy.h:31
constexpr edgeweight defaultEdgeWeight
Definition: Globals.h:29
void setWeight(node u, node v, edgeweight w)
Definition: GraphEventProxy.cpp:61
A graph (with optional weights) and parallel iterator methods.
Definition: Graph.h:79
double edgeweight
Definition: Globals.h:24