# HG changeset patch # User alpar # Date 1086677045 0 # Node ID 7ec5e7e6c7b40e74fbfd93f97c950919ccea1a93 # Parent 38755a4d4b515238a33781b6ae98eb3c068514be c++ setting for emacs Empty commands for doxygen diff -r 38755a4d4b51 -r 7ec5e7e6c7b4 src/work/deba/map_defines.h --- a/src/work/deba/map_defines.h Fri Jun 04 16:05:20 2004 +0000 +++ b/src/work/deba/map_defines.h Tue Jun 08 06:44:05 2004 +0000 @@ -1,3 +1,4 @@ +// -*- c++ -*- #ifndef MAP_DEFINES_H #define MAP_DEFINES_H diff -r 38755a4d4b51 -r 7ec5e7e6c7b4 src/work/deba/map_registry.h --- a/src/work/deba/map_registry.h Fri Jun 04 16:05:20 2004 +0000 +++ b/src/work/deba/map_registry.h Tue Jun 08 06:44:05 2004 +0000 @@ -5,15 +5,14 @@ using namespace std; +namespace hugo { + /** Registry class to register edge or node maps in the graph. The registry helps you to implement an observer pattern. If you add or erase an edge or node you must notify all the maps about the event. */ - -namespace hugo { - template class MapRegistry { public: @@ -23,6 +22,10 @@ + ///. + + ///. + /// class MapBase { public: typedef G Graph; @@ -137,10 +140,13 @@ public: + ///. MapRegistry() {} + ///. MapRegistry(const MapRegistry&) {} + ///. MapRegistry& operator=(const MapRegistry&) { for (it = container.begin(); it != container.end(); ++it) { (*it)->destroy(); @@ -149,6 +155,7 @@ } } + ///. ~MapRegistry() { typename Container::iterator it; for (it = container.begin(); it != container.end(); ++it) { @@ -161,6 +168,7 @@ public: + ///. void attach(MapBase& map) { if (map.registry) { map.registry->detach(map); @@ -170,6 +178,7 @@ map.registry_index = container.size()-1; } + ///. void detach(MapBase& map) { container.back()->registry_index = map.registry_index; container[map.registry_index] = container.back(); @@ -179,6 +188,7 @@ } + ///. virtual void add(Key& key) { typename Container::iterator it; for (it = container.begin(); it != container.end(); ++it) { @@ -186,6 +196,7 @@ } } + ///. virtual void erase(Key& key) { typename Container::iterator it; for (it = container.begin(); it != container.end(); ++it) { diff -r 38755a4d4b51 -r 7ec5e7e6c7b4 src/work/deba/test_graph.h --- a/src/work/deba/test_graph.h Fri Jun 04 16:05:20 2004 +0000 +++ b/src/work/deba/test_graph.h Tue Jun 08 06:44:05 2004 +0000 @@ -34,17 +34,17 @@ class SymEdgeIt; typedef ListGraph Graph; - - CREATE_MAP_REGISTRIES - CREATE_MAPS(ArrayMapFactory) - + + CREATE_MAP_REGISTRIES; + CREATE_MAPS(ArrayMapFactory); + private: - + int node_id; int edge_id; int _node_num; int _edge_num; - + node_item* _first_node; node_item* _last_node;