src/work/deba/edge_map_base.h
changeset 377 33fe0ee01dc5
parent 340 a2ce3c4780b7
equal deleted inserted replaced
2:0c18d6511c96 3:07366a9760c5
     9 	
     9 	
    10 */
    10 */
    11 
    11 
    12 template <typename G, typename K>
    12 template <typename G, typename K>
    13 class EdgeMapBase {
    13 class EdgeMapBase {
       
    14 
       
    15 #include "edge_map_registry.h"
       
    16 
    14 public:
    17 public:
    15 	typedef G Graph;
    18 	typedef G Graph;
       
    19 	friend class EdgeMapRegistry<G, K>;
    16 
    20 
    17 	typedef K KeyType;
    21 	typedef K KeyType;
    18 	
    22 	
    19 	/** 
    23 	/** 
    20 		Default constructor.
    24 		Default constructor.
    75 	/**
    79 	/**
    76 		Helper function to implement the default constructor in the subclasses.
    80 		Helper function to implement the default constructor in the subclasses.
    77 	*/
    81 	*/
    78 	
    82 	
    79 	void init() {
    83 	void init() {
    80 		for (Graph::EdgeIt it(g); g.valid(it); g.next(it)) {
    84 		for (typename Graph::EdgeIt it(g); g.valid(it); g.next(it)) {
    81 			add(it);
    85 			add(it);
    82 		}
    86 		}
    83 	}
    87 	}
    84 	
    88 	
    85 	/**
    89 	/**
    86 		Helper function to implement the destructor in the subclasses.
    90 		Helper function to implement the destructor in the subclasses.
    87 	*/
    91 	*/
    88 	
    92 	
    89 	void destroy() {
    93 	void destroy() {
    90 		for (Graph::EdgeIt it(g); g.valid(it); g.next(it)) {
    94 		for (typename Graph::EdgeIt it(g); g.valid(it); g.next(it)) {
    91 			erase(it);
    95 			erase(it);
    92 		}
    96 		}
    93 	}
    97 	}
    94 	
    98 	
    95 	/** 
    99 	/** 
   110 		Exception class to throw at unsupported operation.
   114 		Exception class to throw at unsupported operation.
   111 	*/
   115 	*/
   112 	
   116 	
   113 	class NotSupportedOperationException {};
   117 	class NotSupportedOperationException {};
   114 
   118 
   115 	friend class Graph;
       
   116 };
   119 };
   117 
   120 
   118 #endif
   121 #endif