src/hugo/smart_graph.h
changeset 806 93246c00cd24
parent 782 df2e45e09652
child 813 65144c52969c
equal deleted inserted replaced
9:2d81cfa10d0a 10:a6e47c1208bb
    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/array_map_factory.h>
    15 #include <hugo/default_map_factory.h>
    16 #include <hugo/sym_map_factory.h>
    16 #include <hugo/sym_map_factory.h>
    17 #include <hugo/map_registry.h>
    17 #include <hugo/map_registry.h>
    18 
    18 
    19 #include <hugo/map_defines.h>
    19 #include <hugo/map_defines.h>
    20 
    20 
    71     class EdgeIt;
    71     class EdgeIt;
    72     class OutEdgeIt;
    72     class OutEdgeIt;
    73     class InEdgeIt;
    73     class InEdgeIt;
    74     
    74     
    75     CREATE_MAP_REGISTRIES;
    75     CREATE_MAP_REGISTRIES;
    76     CREATE_MAPS(ArrayMapFactory);
    76     CREATE_MAPS(DefaultMapFactory);
    77     
    77     
    78   public:
    78   public:
    79 
    79 
    80     SmartGraph() : nodes(), edges() { }
    80     SmartGraph() : nodes(), edges() { }
    81     SmartGraph(const SmartGraph &_g) : nodes(_g.nodes), edges(_g.edges) { }
    81     SmartGraph(const SmartGraph &_g) : nodes(_g.nodes), edges(_g.edges) { }
   294 
   294 
   295     KEEP_NODE_MAP(SmartGraph);
   295     KEEP_NODE_MAP(SmartGraph);
   296     KEEP_EDGE_MAP(SmartGraph);
   296     KEEP_EDGE_MAP(SmartGraph);
   297 
   297 
   298     CREATE_SYM_EDGE_MAP_REGISTRY;
   298     CREATE_SYM_EDGE_MAP_REGISTRY;
   299     CREATE_SYM_EDGE_MAP_FACTORY(ArrayMapFactory);
   299     CREATE_SYM_EDGE_MAP_FACTORY(DefaultMapFactory);
   300     IMPORT_SYM_EDGE_MAP(SymEdgeMapFactory);
   300     IMPORT_SYM_EDGE_MAP(SymEdgeMapFactory);
   301 
   301 
   302     SymSmartGraph() : SmartGraph() { }
   302     SymSmartGraph() : SmartGraph() { }
   303     SymSmartGraph(const SmartGraph &_g) : SmartGraph(_g) { }
   303     SymSmartGraph(const SmartGraph &_g) : SmartGraph(_g) { }
   304     ///Adds a pair of oppositely directed edges to the graph.
   304     ///Adds a pair of oppositely directed edges to the graph.
   305     Edge addEdge(Node u, Node v)
   305     Edge addEdge(Node u, Node v)
   306     {
   306     {
   307       Edge e = SmartGraph::addEdge(u,v);
   307       Edge e = SmartGraph::addEdge(u,v);
   308       SmartGraph::addEdge(v,u);
   308       Edge f = SmartGraph::addEdge(v,u);
       
   309       sym_edge_maps.add(e);
       
   310       sym_edge_maps.add(f);
   309       return e;
   311       return e;
   310     }
   312     }
   311 
   313 
   312     ///The oppositely directed edge.
   314     ///The oppositely directed edge.
   313 
   315