5 /** Creates the EdgeMapRegistry type an declare a mutable instance
8 #define CREATE_EDGE_MAP_REGISTRY \
9 typedef MapRegistry<Graph, Edge, EdgeIt> EdgeMapRegistry; \
10 mutable EdgeMapRegistry edge_maps;
12 /** Creates the NodeMapRegistry type an declare a mutable instance
15 #define CREATE_NODE_MAP_REGISTRY \
16 typedef MapRegistry<Graph, Node, NodeIt> NodeMapRegistry; \
17 mutable NodeMapRegistry node_maps;
19 /** Creates both map registries.
21 #define CREATE_MAP_REGISTRIES \
22 CREATE_NODE_MAP_REGISTRY \
23 CREATE_EDGE_MAP_REGISTRY
25 /** Creates a concrete factory type from a template map
26 * factory to use as node map factory.
28 #define CREATE_NODE_MAP_FACTORY(TemplateFactory) \
29 typedef TemplateFactory<NodeMapRegistry> NodeMapFactory;
31 /** Creates a concrete factory type from a template map
32 * factory to use as edge map factory.
34 #define CREATE_EDGE_MAP_FACTORY(TemplateFactory) \
35 typedef TemplateFactory<EdgeMapRegistry> EdgeMapFactory;
37 /** Creates both map factories.
39 #define CREATE_MAP_FACTORIES(TemplateFactory) \
40 CREATE_NODE_MAP_FACTORY(TemplateFactory) \
41 CREATE_EDGE_MAP_FACTORY(TemplateFactory)
43 /** Import a map from a concrete map factory. The import method is
44 * an overloading of the map type.
45 * The reason to use these macro is that the c++ does not support
46 * the template typedefs. If a future release of the c++
47 * supports this feature it should be fixed.
49 #define IMPORT_NODE_MAP(Factory) \
50 template <typename V> \
51 class NodeMap : public Factory::template Map<V> { \
52 typedef typename Factory::template Map<V> MapImpl; \
55 NodeMap(const Graph& g) : MapImpl(g, g.node_maps) {} \
56 NodeMap(const Graph& g, const V& v) : MapImpl(g, g.node_maps, v) {} \
57 NodeMap(const NodeMap& copy) : MapImpl(static_cast<const MapImpl&>(copy)) {} \
58 template <typename CMap> NodeMap(const CMap& copy) : MapImpl(copy) {} \
59 NodeMap& operator=(const NodeMap& copy) { \
60 MapImpl::operator=(static_cast<const MapImpl&>(copy));\
63 template <typename CMap> NodeMap& operator=(const CMap& copy) { \
64 MapImpl::operator=(copy);\
69 /** Import a map from a concrete map factory. The import method is
70 * an overloading of the map type.
71 * The reason to use these macro is that the c++ does not support
72 * the template typedefs. If a future release of the c++
73 * supports this feature it should be fixed.
75 #define IMPORT_EDGE_MAP(Factory) \
76 template <typename V> \
77 class EdgeMap : public Factory::template Map<V> { \
78 typedef typename Factory::template Map<V> MapImpl; \
81 EdgeMap(const Graph& g) : MapImpl(g, g.edge_maps) {} \
82 EdgeMap(const Graph& g, const V& v) : MapImpl(g, g.edge_maps, v) {} \
83 EdgeMap(const EdgeMap& copy) : MapImpl(static_cast<const MapImpl&>(copy)) {} \
84 template <typename CMap> EdgeMap(const CMap& copy) : MapImpl(copy) {} \
85 EdgeMap& operator=(const EdgeMap& copy) { \
86 MapImpl::operator=(static_cast<const MapImpl&>(copy));\
89 template <typename CMap> EdgeMap& operator=(const CMap& copy) { \
90 MapImpl::operator=(copy);\
95 /** This macro creates both map factories and imports both maps.
97 #define CREATE_MAPS(TemplateFactory) \
98 CREATE_MAP_FACTORIES(TemplateFactory) \
99 IMPORT_NODE_MAP(NodeMapFactory) \
100 IMPORT_EDGE_MAP(EdgeMapFactory)
102 /** This macro creates MapRegistry for Symmetric Edge Maps.
104 #define CREATE_SYM_EDGE_MAP_REGISTRY \
105 typedef SymEdgeIt<Graph, Edge, EdgeIt> SymEdgeIt; \
106 typedef MapRegistry<Graph, Edge, SymEdgeIt> SymEdgeMapRegistry; \
107 mutable EdgeMapRegistry sym_edge_maps;
109 /** Creates a concrete factory type from a template map
110 * factory to use as edge map factory.
112 #define CREATE_SYM_EDGE_MAP_FACTORY(TemplateFactory) \
113 typedef SymMapFactory<SymEdgeMapRegistry, TemplateFactory > \
116 /** Import a map from a concrete map factory. The import method is
117 * an overloading of the map type.
118 * The reason to use these macro is that the c++ does not support
119 * the template typedefs. If a future release of the c++
120 * supports this feature it should be fixed.
122 #define IMPORT_SYM_EDGE_MAP(Factory) \
123 template <typename V> \
124 class SymEdgeMap : public Factory::template Map<V> { \
125 typedef typename Factory::template Map<V> MapImpl; \
128 SymEdgeMap(const Graph& g) : MapImpl(g, g.sym_edge_maps) {} \
129 SymEdgeMap(const Graph& g, const V& v) : MapImpl(g, g.sym_edge_maps, v) {} \
130 SymEdgeMap(const SymEdgeMap& copy) \
131 : MapImpl(static_cast<const MapImpl&>(copy)) {} \
132 template <typename CMap> SymEdgeMap(const CMap& copy) : MapImpl(copy) {} \
133 SymEdgeMap& operator=(const SymEdgeMap& copy) { \
134 MapImpl::operator=(static_cast<const MapImpl&>(copy));\
137 template <typename CMap> SymEdgeMap& operator=(const CMap& copy) { \
138 MapImpl::operator=(copy);\
144 #define KEEP_NODE_MAP(GraphBase) \
145 template <typename V> class NodeMap \
146 : public GraphBase::template NodeMap<V> \
148 typedef typename GraphBase::template NodeMap<V> MapImpl; \
151 NodeMap() : MapImpl() {} \
153 NodeMap(const Graph& graph) \
154 : MapImpl(static_cast<const GraphBase&>(graph)) { } \
156 NodeMap(const Graph& graph, const Value& value) \
157 : MapImpl(static_cast<const GraphBase&>(graph), value) { } \
159 NodeMap(const NodeMap& copy) \
160 : MapImpl(static_cast<const MapImpl&>(copy)) {} \
162 template<typename CMap> \
163 NodeMap(const CMap& copy) \
166 NodeMap& operator=(const NodeMap& copy) { \
167 MapImpl::operator=(static_cast<const MapImpl&>(copy)); \
171 template <typename CMap> \
172 NodeMap& operator=(const CMap& copy) { \
173 MapImpl::operator=(copy); \
178 #define KEEP_EDGE_MAP(GraphBase) \
179 template <typename V> class EdgeMap \
180 : public GraphBase::template EdgeMap<V> \
182 typedef typename GraphBase::template EdgeMap<V> MapImpl; \
185 EdgeMap() : MapImpl() {} \
187 EdgeMap(const Graph& graph) \
188 : MapImpl(static_cast<const GraphBase&>(graph)) { } \
190 EdgeMap(const Graph& graph, const Value& value) \
191 : MapImpl(static_cast<const GraphBase&>(graph), value) { } \
193 EdgeMap(const EdgeMap& copy) \
194 : MapImpl(static_cast<const MapImpl&>(copy)) {} \
196 template<typename CMap> \
197 EdgeMap(const CMap& copy) \
200 EdgeMap& operator=(const EdgeMap& copy) { \
201 MapImpl::operator=(static_cast<const MapImpl&>(copy)); \
205 template <typename CMap> \
206 EdgeMap& operator=(const CMap& copy) { \
207 MapImpl::operator=(copy); \