1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/work/deba/map_defines.h Fri Jun 04 11:52:53 2004 +0000
1.3 @@ -0,0 +1,47 @@
1.4 +#ifndef MAP_DEFINES_H
1.5 +#define MAP_DEFINES_H
1.6 +
1.7 +#define CREATE_EDGE_MAP_REGISTRY \
1.8 +typedef MapRegistry<Graph, Edge, EdgeIt> EdgeMapRegistry; \
1.9 +EdgeMapRegistry edge_maps;
1.10 +
1.11 +#define CREATE_NODE_MAP_REGISTRY \
1.12 +typedef MapRegistry<Graph, Node, NodeIt> NodeMapRegistry; \
1.13 +NodeMapRegistry node_maps;
1.14 +
1.15 +#define CREATE_MAP_REGISTRIES \
1.16 +CREATE_NODE_MAP_REGISTRY \
1.17 +CREATE_EDGE_MAP_REGISTRY
1.18 +
1.19 +#define CREATE_NODE_MAP_FACTORY(TemplateFactory) \
1.20 +typedef TemplateFactory<NodeMapRegistry> NodeMapFactory;
1.21 +
1.22 +#define CREATE_EDGE_MAP_FACTORY(TemplateFactory) \
1.23 +typedef TemplateFactory<EdgeMapRegistry> EdgeMapFactory;
1.24 +
1.25 +#define CREATE_MAP_FACTORIES(TemplateFactory) \
1.26 +CREATE_NODE_MAP_FACTORY(TemplateFactory) \
1.27 +CREATE_EDGE_MAP_FACTORY(TemplateFactory)
1.28 +
1.29 +#define IMPORT_NODE_MAP(Factory) \
1.30 +template <typename V> \
1.31 +class NodeMap : public Factory::Map<V> { \
1.32 +public: \
1.33 +NodeMap() {} \
1.34 +NodeMap(Graph& g) : Factory::Map<V>(g, g.node_maps) {} \
1.35 +};
1.36 +
1.37 +#define IMPORT_EDGE_MAP(Factory) \
1.38 +template <typename V> \
1.39 +class EdgeMap : public Factory::Map<V> { \
1.40 +public: \
1.41 +EdgeMap() {} \
1.42 +EdgeMap(Graph& g) : Factory::Map<V>(g, g.edge_maps) {} \
1.43 +};
1.44 +
1.45 +#define CREATE_MAPS(TemplateFactory) \
1.46 +CREATE_MAP_FACTORIES(TemplateFactory) \
1.47 +IMPORT_NODE_MAP(NodeMapFactory) \
1.48 +IMPORT_EDGE_MAP(EdgeMapFactory)
1.49 +
1.50 +#endif