author | klao |
Fri, 04 Jun 2004 16:05:20 +0000 | |
changeset 675 | 38755a4d4b51 |
child 676 | 7ec5e7e6c7b4 |
permissions | -rw-r--r-- |
deba@674 | 1 |
#ifndef MAP_DEFINES_H |
deba@674 | 2 |
#define MAP_DEFINES_H |
deba@674 | 3 |
|
deba@674 | 4 |
#define CREATE_EDGE_MAP_REGISTRY \ |
deba@674 | 5 |
typedef MapRegistry<Graph, Edge, EdgeIt> EdgeMapRegistry; \ |
deba@674 | 6 |
EdgeMapRegistry edge_maps; |
deba@674 | 7 |
|
deba@674 | 8 |
#define CREATE_NODE_MAP_REGISTRY \ |
deba@674 | 9 |
typedef MapRegistry<Graph, Node, NodeIt> NodeMapRegistry; \ |
deba@674 | 10 |
NodeMapRegistry node_maps; |
deba@674 | 11 |
|
deba@674 | 12 |
#define CREATE_MAP_REGISTRIES \ |
deba@674 | 13 |
CREATE_NODE_MAP_REGISTRY \ |
deba@674 | 14 |
CREATE_EDGE_MAP_REGISTRY |
deba@674 | 15 |
|
deba@674 | 16 |
#define CREATE_NODE_MAP_FACTORY(TemplateFactory) \ |
deba@674 | 17 |
typedef TemplateFactory<NodeMapRegistry> NodeMapFactory; |
deba@674 | 18 |
|
deba@674 | 19 |
#define CREATE_EDGE_MAP_FACTORY(TemplateFactory) \ |
deba@674 | 20 |
typedef TemplateFactory<EdgeMapRegistry> EdgeMapFactory; |
deba@674 | 21 |
|
deba@674 | 22 |
#define CREATE_MAP_FACTORIES(TemplateFactory) \ |
deba@674 | 23 |
CREATE_NODE_MAP_FACTORY(TemplateFactory) \ |
deba@674 | 24 |
CREATE_EDGE_MAP_FACTORY(TemplateFactory) |
deba@674 | 25 |
|
deba@674 | 26 |
#define IMPORT_NODE_MAP(Factory) \ |
deba@674 | 27 |
template <typename V> \ |
deba@674 | 28 |
class NodeMap : public Factory::Map<V> { \ |
deba@674 | 29 |
public: \ |
deba@674 | 30 |
NodeMap() {} \ |
deba@674 | 31 |
NodeMap(Graph& g) : Factory::Map<V>(g, g.node_maps) {} \ |
deba@674 | 32 |
}; |
deba@674 | 33 |
|
deba@674 | 34 |
#define IMPORT_EDGE_MAP(Factory) \ |
deba@674 | 35 |
template <typename V> \ |
deba@674 | 36 |
class EdgeMap : public Factory::Map<V> { \ |
deba@674 | 37 |
public: \ |
deba@674 | 38 |
EdgeMap() {} \ |
deba@674 | 39 |
EdgeMap(Graph& g) : Factory::Map<V>(g, g.edge_maps) {} \ |
deba@674 | 40 |
}; |
deba@674 | 41 |
|
deba@674 | 42 |
#define CREATE_MAPS(TemplateFactory) \ |
deba@674 | 43 |
CREATE_MAP_FACTORIES(TemplateFactory) \ |
deba@674 | 44 |
IMPORT_NODE_MAP(NodeMapFactory) \ |
deba@674 | 45 |
IMPORT_EDGE_MAP(EdgeMapFactory) |
deba@674 | 46 |
|
deba@674 | 47 |
#endif |