COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/work/deba/map_defines.h @ 675:38755a4d4b51

Last change on this file since 675:38755a4d4b51 was 674:7733d18de0e8, checked in by Balazs Dezso, 20 years ago
File size: 1.2 KB
Line 
1#ifndef MAP_DEFINES_H
2#define MAP_DEFINES_H
3
4#define CREATE_EDGE_MAP_REGISTRY \
5typedef MapRegistry<Graph, Edge, EdgeIt> EdgeMapRegistry; \
6EdgeMapRegistry edge_maps;
7
8#define CREATE_NODE_MAP_REGISTRY \
9typedef MapRegistry<Graph, Node, NodeIt> NodeMapRegistry; \
10NodeMapRegistry node_maps;
11
12#define CREATE_MAP_REGISTRIES \
13CREATE_NODE_MAP_REGISTRY \
14CREATE_EDGE_MAP_REGISTRY
15
16#define CREATE_NODE_MAP_FACTORY(TemplateFactory) \
17typedef TemplateFactory<NodeMapRegistry> NodeMapFactory;
18
19#define CREATE_EDGE_MAP_FACTORY(TemplateFactory) \
20typedef TemplateFactory<EdgeMapRegistry> EdgeMapFactory;
21
22#define CREATE_MAP_FACTORIES(TemplateFactory) \
23CREATE_NODE_MAP_FACTORY(TemplateFactory) \
24CREATE_EDGE_MAP_FACTORY(TemplateFactory)
25
26#define IMPORT_NODE_MAP(Factory) \
27template <typename V> \
28class NodeMap : public Factory::Map<V> { \
29public: \
30NodeMap() {} \
31NodeMap(Graph& g) : Factory::Map<V>(g, g.node_maps) {} \
32};
33
34#define IMPORT_EDGE_MAP(Factory) \
35template <typename V> \
36class EdgeMap : public Factory::Map<V> { \
37public: \
38EdgeMap() {} \
39EdgeMap(Graph& g) : Factory::Map<V>(g, g.edge_maps) {} \
40};
41
42#define CREATE_MAPS(TemplateFactory) \
43CREATE_MAP_FACTORIES(TemplateFactory) \
44IMPORT_NODE_MAP(NodeMapFactory) \
45IMPORT_EDGE_MAP(EdgeMapFactory)
46
47#endif
Note: See TracBrowser for help on using the repository browser.