src/work/deba/map_registry.h
changeset 595 e10b5e9419ef
parent 571 9632ea8be6ca
child 627 6cc21a9c9fda
     1.1 --- a/src/work/deba/map_registry.h	Mon May 10 09:12:28 2004 +0000
     1.2 +++ b/src/work/deba/map_registry.h	Mon May 10 13:49:35 2004 +0000
     1.3 @@ -3,6 +3,8 @@
     1.4  
     1.5  #include <vector>
     1.6  
     1.7 +using namespace std;
     1.8 +
     1.9  
    1.10  namespace hugo {
    1.11  	template <typename G, typename K, typename KIt>
    1.12 @@ -62,27 +64,25 @@
    1.13  			container.push_back(&map);
    1.14  			map.registry = this;
    1.15  			map.registry_index = container.size()-1;
    1.16 -			map.init();
    1.17  		} 
    1.18  	
    1.19 -		void detach(Map& map_base) {
    1.20 -			map_base.destroy();
    1.21 -			container.back()->registry_index = map_base.registry_index; 
    1.22 -			container[map_base.registry_index] = container.back();
    1.23 +		void detach(Map& map) {
    1.24 +			container.back()->registry_index = map.registry_index; 
    1.25 +			container[map.registry_index] = container.back();
    1.26  			container.pop_back();
    1.27 -			map_base.registry = 0;
    1.28 -			map_base.graph = 0;
    1.29 +			map.registry = 0;
    1.30 +			map.graph = 0;
    1.31  		}
    1.32  	
    1.33  		
    1.34 -		void add(Key& key) {
    1.35 +		virtual void add(Key& key) {
    1.36  			typename Container::iterator it;
    1.37  			for (it = container.begin(); it != container.end(); ++it) {
    1.38  				(*it)->add(key);
    1.39  			}
    1.40  		}	
    1.41  		
    1.42 -		void erase(Key& key) {
    1.43 +		virtual void erase(Key& key) {
    1.44  			typename Container::iterator it;
    1.45  			for (it = container.begin(); it != container.end(); ++it) {
    1.46  				(*it)->erase(key);