Changeset 799:3393abe30678 in lemon-0.x for src/hugo/default_map_factory.h
- Timestamp:
- 09/03/04 17:32:03 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1093
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/default_map_factory.h
r798 r799 7 7 #include <hugo/vector_map_factory.h> 8 8 9 ///\ingroup graphmapfactory 10 ///\file 11 ///\brief Graph maps that construates and destruates 12 ///their elements dynamically. 13 9 14 namespace hugo { 15 16 /// \addtogroup graphmapfactory 17 /// @{ 10 18 11 19 #define DEFAULT_MAP_BODY(Factory, Val) \ … … 16 24 \ 17 25 typedef typename MapRegistry::Graph Graph; \ 18 typedef typename MapRegistry::Key Key; \26 typedef typename MapRegistry::KeyType KeyType; \ 19 27 typedef typename MapRegistry::KeyIt KeyIt; \ 20 28 typedef Val Value; \ … … 96 104 DEFAULT_MAP_BODY(VectorMapFactory, Type*); 97 105 106 107 /** The DefaultMapFactory template class is a factory class 108 * to create maps for the edge and nodes. This map factory 109 * uses the VectorMapFactory if the ValueType is a primitive 110 * type and the ArrayMapFactory for the other cases. 111 * 112 * The template parameter is the MapRegistry that the maps 113 * will belong to. 114 */ 115 98 116 template <typename MapRegistry> 99 117 class DefaultMapFactory { 100 118 101 119 public: 102 120 /// The graph type of the maps. 103 121 typedef typename MapRegistry::Graph Graph; 104 typedef typename MapRegistry::Key Key; 122 /// The key type of the maps. 123 typedef typename MapRegistry::KeyType KeyType; 124 /// The iterator to iterate on the keys. 105 125 typedef typename MapRegistry::KeyIt KeyIt; 106 126 127 /// The MapBase of the Map which imlements the core regisitry function. 107 128 typedef typename MapRegistry::MapBase MapBase; 129 108 130 131 /** The template Map type. 132 */ 109 133 template <typename V> 110 134 class Map : public DefaultMap<MapRegistry, V> { … … 116 140 typedef V Value; 117 141 142 /** Default constructor for the map. 143 */ 118 144 Map() : MapImpl() {} 119 145 146 /** Graph and Registry initialized map constructor. 147 */ 120 148 Map(const Graph& g, MapRegistry& r) : MapImpl(g, r) {} 121 149 150 /** Constructor to use default value to initialize the map. 151 */ 122 152 Map(const Graph& g, MapRegistry& r, const Value& v) : MapImpl(g, r, v) {} 123 153 154 /** Constructor to copy a map of the same map type. 155 */ 124 156 Map(const Map& copy) : MapImpl(static_cast<const MapImpl&>(copy)) {} 125 157 158 /** Constructor to copy a map of an other map type. 159 */ 126 160 template <typename CMap> Map(const CMap& copy) : MapImpl(copy) {} 127 161 162 /** Assign operator to copy a map of the same map type. 163 */ 128 164 Map& operator=(const Map& copy) { 129 165 MapImpl::operator=(static_cast<const MapImpl&>(copy)); … … 131 167 } 132 168 169 /** Assign operator to copy a map an other map type. 170 */ 133 171 template <typename CMap> Map& operator=(const CMap& copy) { 134 172 MapImpl::operator=(copy);
Note: See TracChangeset
for help on using the changeset viewer.