src/work/deba/map_defines.h
changeset 675 38755a4d4b51
child 676 7ec5e7e6c7b4
equal deleted inserted replaced
-1:000000000000 0:e7ec84cdd729
       
     1 #ifndef MAP_DEFINES_H
       
     2 #define MAP_DEFINES_H
       
     3 
       
     4 #define CREATE_EDGE_MAP_REGISTRY \
       
     5 typedef MapRegistry<Graph, Edge, EdgeIt> EdgeMapRegistry; \
       
     6 EdgeMapRegistry edge_maps;
       
     7 
       
     8 #define CREATE_NODE_MAP_REGISTRY \
       
     9 typedef MapRegistry<Graph, Node, NodeIt> NodeMapRegistry; \
       
    10 NodeMapRegistry node_maps;
       
    11 
       
    12 #define CREATE_MAP_REGISTRIES \
       
    13 CREATE_NODE_MAP_REGISTRY \
       
    14 CREATE_EDGE_MAP_REGISTRY
       
    15 
       
    16 #define CREATE_NODE_MAP_FACTORY(TemplateFactory) \
       
    17 typedef TemplateFactory<NodeMapRegistry> NodeMapFactory;
       
    18 
       
    19 #define CREATE_EDGE_MAP_FACTORY(TemplateFactory) \
       
    20 typedef TemplateFactory<EdgeMapRegistry> EdgeMapFactory;
       
    21 
       
    22 #define CREATE_MAP_FACTORIES(TemplateFactory) \
       
    23 CREATE_NODE_MAP_FACTORY(TemplateFactory) \
       
    24 CREATE_EDGE_MAP_FACTORY(TemplateFactory) 
       
    25 
       
    26 #define IMPORT_NODE_MAP(Factory) \
       
    27 template <typename V> \
       
    28 class NodeMap : public Factory::Map<V> { \
       
    29 public: \
       
    30 NodeMap() {} \
       
    31 NodeMap(Graph& g) : Factory::Map<V>(g, g.node_maps) {} \
       
    32 };
       
    33 
       
    34 #define IMPORT_EDGE_MAP(Factory) \
       
    35 template <typename V> \
       
    36 class EdgeMap : public Factory::Map<V> { \
       
    37 public: \
       
    38 EdgeMap() {} \
       
    39 EdgeMap(Graph& g) : Factory::Map<V>(g, g.edge_maps) {} \
       
    40 };
       
    41 
       
    42 #define CREATE_MAPS(TemplateFactory) \
       
    43 CREATE_MAP_FACTORIES(TemplateFactory) \
       
    44 IMPORT_NODE_MAP(NodeMapFactory) \
       
    45 IMPORT_EDGE_MAP(EdgeMapFactory)
       
    46 
       
    47 #endif