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 map 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 map 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::Map<V> { \
54 NodeMap(const Graph& g) : Factory::Map<V>(&g, &(g.node_maps)) {} \
55 NodeMap(const Graph& g, const V& v) : Factory::Map<V>(g, g.node_maps, v) {} \
56 NodeMap(const NodeMap& copy) : Factory::Map<V>(copy) {} \
57 template <typename CMap> NodeMap(const CMap& copy) : Factory::Map<V>(copy) {} \
58 NodeMap& operator=(const NodeMap& copy) { \
59 this->Factory::Map<V>::operator=(copy); \
62 template <typename CMap>NodeMap& operator=(const CMap& copy) { \
63 this->Factory::Map<V>::operator=<CMap>(copy); \
68 /** Import a map from a concrete map factory. The import method is
69 * an overloading of the map type.
70 * The reason to use these macro is that the c++ does not support
71 * the template typedefs. If a future release of the c++
72 * supports this feature it should be fixed.
74 #define IMPORT_EDGE_MAP(Factory) \
75 template <typename V> \
76 class EdgeMap : public Factory::Map<V> { \
79 EdgeMap(const Graph& g) : Factory::Map<V>(g, g.edge_maps) {} \
80 EdgeMap(const Graph& g, const V& v) : Factory::Map<V>(g, g.node_maps, v) {} \
81 EdgeMap(const EdgeMap& copy) : Factory::Map<V>(copy) {} \
82 template <typename CMap> EdgeMap(const CMap& copy) : Factory::Map<V>(copy) {} \
83 EdgeMap& operator=(const EdgeMap& copy) { \
84 this->Factory::Map<V>::operator=(copy); \
87 template <typename CMap>EdgeMap& operator=(const CMap& copy) { \
88 this->Factory::Map<V>::operator=<CMap>(copy); \
93 /** This macro creates both map factories and imports both maps.
95 #define CREATE_MAPS(TemplateFactory) \
96 CREATE_MAP_FACTORIES(TemplateFactory) \
97 IMPORT_NODE_MAP(NodeMapFactory) \
98 IMPORT_EDGE_MAP(EdgeMapFactory)