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