src/hugo/smart_graph.h
changeset 838 51dcd224455c
parent 813 65144c52969c
child 880 9d0bfd35b97c
equal deleted inserted replaced
11:11aeffec149b 12:e3791bce2793
    10 #include <vector>
    10 #include <vector>
    11 #include <climits>
    11 #include <climits>
    12 
    12 
    13 #include <hugo/invalid.h>
    13 #include <hugo/invalid.h>
    14 
    14 
    15 #include <hugo/default_map_factory.h>
    15 #include <hugo/default_map.h>
    16 #include <hugo/sym_map_factory.h>
    16 #include <hugo/sym_map.h>
       
    17 
    17 #include <hugo/map_registry.h>
    18 #include <hugo/map_registry.h>
    18 
    19 
    19 #include <hugo/map_defines.h>
    20 #include <hugo/map_defines.h>
    20 
    21 
    21 namespace hugo {
    22 namespace hugo {
    70     class NodeIt;
    71     class NodeIt;
    71     class EdgeIt;
    72     class EdgeIt;
    72     class OutEdgeIt;
    73     class OutEdgeIt;
    73     class InEdgeIt;
    74     class InEdgeIt;
    74     
    75     
       
    76     /// Creating map registries.
    75     CREATE_MAP_REGISTRIES;
    77     CREATE_MAP_REGISTRIES;
    76     CREATE_MAPS(DefaultMapFactory);
    78     /// Creating node and edge maps.
       
    79     CREATE_MAPS(DefaultMap);
    77     
    80     
    78   public:
    81   public:
    79 
    82 
    80     SmartGraph() : nodes(), edges() { }
    83     SmartGraph() : nodes(), edges() { }
    81     SmartGraph(const SmartGraph &_g) : nodes(_g.nodes), edges(_g.edges) { }
    84     SmartGraph(const SmartGraph &_g) : nodes(_g.nodes), edges(_g.edges) { }
   312   class SymSmartGraph : public SmartGraph
   315   class SymSmartGraph : public SmartGraph
   313   {
   316   {
   314   public:
   317   public:
   315     typedef SymSmartGraph Graph;
   318     typedef SymSmartGraph Graph;
   316 
   319 
   317     KEEP_NODE_MAP(SmartGraph);
   320     /// Importing maps from the base class ListGraph.
   318     KEEP_EDGE_MAP(SmartGraph);
   321     KEEP_MAPS(SmartGraph, SymSmartGraph);
   319 
   322 
       
   323     /// Creating symmetric map registry.
   320     CREATE_SYM_EDGE_MAP_REGISTRY;
   324     CREATE_SYM_EDGE_MAP_REGISTRY;
   321     CREATE_SYM_EDGE_MAP_FACTORY(DefaultMapFactory);
   325     /// Creating symmetric edge map.
   322     IMPORT_SYM_EDGE_MAP(SymEdgeMapFactory);
   326     CREATE_SYM_EDGE_MAP(DefaultMap);
       
   327 
   323 
   328 
   324     SymSmartGraph() : SmartGraph() { }
   329     SymSmartGraph() : SmartGraph() { }
   325     SymSmartGraph(const SmartGraph &_g) : SmartGraph(_g) { }
   330     SymSmartGraph(const SmartGraph &_g) : SmartGraph(_g) { }
   326     ///Adds a pair of oppositely directed edges to the graph.
   331     ///Adds a pair of oppositely directed edges to the graph.
   327     Edge addEdge(Node u, Node v)
   332     Edge addEdge(Node u, Node v)