Changeset 1039:bd01c5a3f989 in lemon-0.x for src/lemon
- Timestamp:
- 12/16/04 13:26:57 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1429
- Location:
- src/lemon
- Files:
-
- 9 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/Makefile.am
r980 r1039 15 15 kruskal.h \ 16 16 list_graph.h \ 17 alteration_ observer_registry.h \17 alteration_notifier.h \ 18 18 maps.h \ 19 19 min_cost_flow.h \ -
src/lemon/alteration_notifier.h
r1038 r1039 188 188 /// It creates only an empty registry because the copiable 189 189 /// registry's observers have to be registered still into that registry. 190 AlterationNotifier(const Alteration ObserverRegistry&) {}190 AlterationNotifier(const AlterationNotifier&) {} 191 191 192 192 /// Assign operator. … … 195 195 /// It makes the registry only empty because the copiable 196 196 /// registry's observers have to be registered still into that registry. 197 AlterationNotifier& operator=(const Alteration ObserverRegistry&) {197 AlterationNotifier& operator=(const AlterationNotifier&) { 198 198 typename Container::iterator it; 199 199 for (it = container.begin(); it != container.end(); ++it) { … … 309 309 310 310 /// The edge observer registry. 311 typedef AlterationNotifier<Edge> Edge ObserverRegistry;311 typedef AlterationNotifier<Edge> EdgeNotifier; 312 312 /// The node observer registry. 313 typedef AlterationNotifier<Node> Node ObserverRegistry;313 typedef AlterationNotifier<Node> NodeNotifier; 314 314 315 315 … … 322 322 public: 323 323 324 EdgeNotifier& get ObserverRegistry(Edge = INVALID) const {324 EdgeNotifier& getNotifier(Edge = INVALID) const { 325 325 return edge_observers; 326 326 } 327 327 328 NodeNotifier& get ObserverRegistry(Node = INVALID) const {328 NodeNotifier& getNotifier(Node = INVALID) const { 329 329 return node_observers; 330 330 } … … 359 359 360 360 /// The edge observer registry. 361 typedef AlterationNotifier<UndirEdge> UndirEdge ObserverRegistry;361 typedef AlterationNotifier<UndirEdge> UndirEdgeNotifier; 362 362 363 363 protected: … … 368 368 369 369 using Parent::getNotifier; 370 UndirEdgeNotifier& get ObserverRegistry(UndirEdge) const {370 UndirEdgeNotifier& getNotifier(UndirEdge) const { 371 371 return undir_edge_observers; 372 372 } -
src/lemon/array_map.h
r988 r1039 44 44 typename _ItemIt, 45 45 typename _Value> 46 class ArrayMap : public Alteration ObserverRegistry<_Item>::ObserverBase {46 class ArrayMap : public AlterationNotifier<_Item>::ObserverBase { 47 47 48 48 public: … … 53 53 typedef _Item Key; 54 54 55 typedef Alteration ObserverRegistry<_Item> Registry;55 typedef AlterationNotifier<_Item> Registry; 56 56 57 57 private: … … 89 89 */ 90 90 ArrayMap(const Graph& _g) : graph(&_g) { 91 attach(_g.get ObserverRegistry(_Item()));91 attach(_g.getNotifier(_Item())); 92 92 allocate_memory(); 93 93 for (KeyIt it(*graph); it != INVALID; ++it) { … … 102 102 103 103 ArrayMap(const Graph& _g, const Value& _v) : graph(&_g) { 104 attach(_g.get ObserverRegistry(_Item()));104 attach(_g.getNotifier(_Item())); 105 105 allocate_memory(); 106 106 for (KeyIt it(*graph); it != INVALID; ++it) { … … 337 337 typedef typename Parent::Node Node; 338 338 typedef typename Parent::NodeIt NodeIt; 339 typedef typename Parent::Node ObserverRegistryNodeObserverRegistry;339 typedef typename Parent::NodeNotifier NodeObserverRegistry; 340 340 341 341 typedef typename Parent::Edge Edge; 342 342 typedef typename Parent::EdgeIt EdgeIt; 343 typedef typename Parent::Edge ObserverRegistryEdgeObserverRegistry;343 typedef typename Parent::EdgeNotifier EdgeObserverRegistry; 344 344 345 345 -
src/lemon/clearable_graph_extender.h
r1022 r1039 19 19 20 20 void clear() { 21 Parent::get ObserverRegistry(Node()).clear();22 Parent::get ObserverRegistry(Edge()).clear();21 Parent::getNotifier(Node()).clear(); 22 Parent::getNotifier(Edge()).clear(); 23 23 Parent::clear(); 24 24 } … … 37 37 38 38 void clear() { 39 Parent::get ObserverRegistry(Node()).clear();40 Parent::get ObserverRegistry(UndirEdge()).clear();41 Parent::get ObserverRegistry(Edge()).clear();39 Parent::getNotifier(Node()).clear(); 40 Parent::getNotifier(UndirEdge()).clear(); 41 Parent::getNotifier(Edge()).clear(); 42 42 Parent::clear(); 43 43 } -
src/lemon/erasable_graph_extender.h
r1022 r1039 33 33 } 34 34 35 Parent::get ObserverRegistry(Node()).erase(node);35 Parent::getNotifier(Node()).erase(node); 36 36 Parent::erase(node); 37 37 } 38 38 39 39 void erase(const Edge& edge) { 40 Parent::get ObserverRegistry(Edge()).erase(edge);40 Parent::getNotifier(Edge()).erase(edge); 41 41 Parent::erase(edge); 42 42 } … … 63 63 } 64 64 65 Parent::get ObserverRegistry(Node()).erase(node);65 Parent::getNotifier(Node()).erase(node); 66 66 Parent::erase(node); 67 67 } 68 68 69 69 void erase(const UndirEdge& uedge) { 70 Parent::get ObserverRegistry(Edge()).erase(Edge(uedge,true));71 Parent::get ObserverRegistry(Edge()).erase(Edge(uedge,false));72 Parent::get ObserverRegistry(UndirEdge()).erase(uedge);70 Parent::getNotifier(Edge()).erase(Edge(uedge,true)); 71 Parent::getNotifier(Edge()).erase(Edge(uedge,false)); 72 Parent::getNotifier(UndirEdge()).erase(uedge); 73 73 Parent::erase(uedge); 74 74 } -
src/lemon/extendable_graph_extender.h
r1022 r1039 18 18 Node addNode() { 19 19 Node node = Parent::addNode(); 20 Parent::get ObserverRegistry(Node()).add(node);20 Parent::getNotifier(Node()).add(node); 21 21 return node; 22 22 } … … 24 24 Edge addEdge(const Node& from, const Node& to) { 25 25 Edge edge = Parent::addEdge(from, to); 26 Parent::get ObserverRegistry(Edge()).add(edge);26 Parent::getNotifier(Edge()).add(edge); 27 27 return edge; 28 28 } … … 43 43 Node addNode() { 44 44 Node node = Parent::addNode(); 45 Parent::get ObserverRegistry(Node()).add(node);45 Parent::getNotifier(Node()).add(node); 46 46 return node; 47 47 } … … 49 49 UndirEdge addEdge(const Node& from, const Node& to) { 50 50 UndirEdge uedge = Parent::addEdge(from, to); 51 Parent::get ObserverRegistry(UndirEdge()).add(uedge);51 Parent::getNotifier(UndirEdge()).add(uedge); 52 52 53 53 Edge edge_forward(uedge, true); 54 54 Edge edge_backward(uedge, false); 55 Parent::get ObserverRegistry(Edge()).add(edge_forward);56 Parent::get ObserverRegistry(Edge()).add(edge_backward);55 Parent::getNotifier(Edge()).add(edge_forward); 56 Parent::getNotifier(Edge()).add(edge_backward); 57 57 58 58 return uedge; -
src/lemon/full_graph.h
r986 r1039 22 22 23 23 #include <lemon/iterable_graph_extender.h> 24 #include <lemon/alteration_ observer_registry.h>24 #include <lemon/alteration_notifier.h> 25 25 #include <lemon/default_map.h> 26 26 -
src/lemon/list_graph.h
r1035 r1039 26 26 #include <lemon/extendable_graph_extender.h> 27 27 #include <lemon/iterable_graph_extender.h> 28 #include <lemon/alteration_ observer_registry.h>28 #include <lemon/alteration_notifier.h> 29 29 #include <lemon/default_map.h> 30 30 … … 400 400 ///\ingroup graphs 401 401 ///\todo \c SnapShot or \c Snapshot? 402 class SnapShot : protected Alteration ObserverRegistry<Node>::ObserverBase,403 protected Alteration ObserverRegistry<Edge>::ObserverBase402 class SnapShot : protected AlterationNotifier<Node>::ObserverBase, 403 protected AlterationNotifier<Edge>::ObserverBase 404 404 { 405 405 protected: … … 431 431 void regist(ListGraph &_g) { 432 432 g=&_g; 433 Alteration ObserverRegistry<Node>::ObserverBase::433 AlterationNotifier<Node>::ObserverBase:: 434 434 attach(g->node_observers); 435 Alteration ObserverRegistry<Edge>::ObserverBase::435 AlterationNotifier<Edge>::ObserverBase:: 436 436 attach(g->edge_observers); 437 437 } 438 438 439 439 void deregist() { 440 Alteration ObserverRegistry<Node>::ObserverBase::440 AlterationNotifier<Node>::ObserverBase:: 441 441 detach(); 442 Alteration ObserverRegistry<Edge>::ObserverBase::442 AlterationNotifier<Edge>::ObserverBase:: 443 443 detach(); 444 444 g=0; -
src/lemon/smart_graph.h
r1035 r1039 29 29 #include <lemon/extendable_graph_extender.h> 30 30 #include <lemon/iterable_graph_extender.h> 31 #include <lemon/alteration_ observer_registry.h>31 #include <lemon/alteration_notifier.h> 32 32 #include <lemon/default_map.h> 33 33 -
src/lemon/vector_map.h
r987 r1039 21 21 #include <algorithm> 22 22 23 #include <lemon/alteration_ observer_registry.h>23 #include <lemon/alteration_notifier.h> 24 24 25 25 ///\ingroup graphmaps … … 38 38 /// uses the std::vector to implement the container function. 39 39 /// 40 /// \param Registry The Alteration ObserverRegistrythat will notify this map.40 /// \param Registry The AlterationNotifier that will notify this map. 41 41 /// \param IdMap The IdMap type of the graph items. 42 42 /// \param Value The value type of the map. … … 48 48 typename _Item, 49 49 typename _Value> 50 class VectorMap : public Alteration ObserverRegistry<_Item>::ObserverBase {50 class VectorMap : public AlterationNotifier<_Item>::ObserverBase { 51 51 public: 52 52 … … 56 56 typedef _Item Key; 57 57 /// The id map type of the map. 58 typedef Alteration ObserverRegistry<_Item> Registry;58 typedef AlterationNotifier<_Item> Registry; 59 59 /// The value type of the map. 60 60 typedef _Value Value; … … 90 90 91 91 VectorMap(const Graph& _g) : graph(&_g) { 92 attach(_g.get ObserverRegistry(_Item()));92 attach(_g.getNotifier(_Item())); 93 93 build(); 94 94 } … … 100 100 101 101 VectorMap(const Graph& _g, const Value& _v) : graph(&_g) { 102 attach(_g.get ObserverRegistry(_Item()));102 attach(_g.getNotifier(_Item())); 103 103 container.resize(graph->maxId(_Item()) + 1, _v); 104 104 } … … 225 225 typedef typename Parent::NodeIt NodeIt; 226 226 typedef typename Parent::NodeIdMap NodeIdMap; 227 typedef typename Parent::Node ObserverRegistryNodeObserverRegistry;227 typedef typename Parent::NodeNotifier NodeObserverRegistry; 228 228 229 229 typedef typename Parent::Edge Edge; 230 230 typedef typename Parent::EdgeIt EdgeIt; 231 231 typedef typename Parent::EdgeIdMap EdgeIdMap; 232 typedef typename Parent::Edge ObserverRegistryEdgeObserverRegistry;232 typedef typename Parent::EdgeNotifier EdgeObserverRegistry; 233 233 234 234
Note: See TracChangeset
for help on using the changeset viewer.