COIN-OR::LEMON - Graph Library

Changeset 617:4137ef9aacc6 in lemon-1.2 for lemon/edge_set.h


Ignore:
Timestamp:
04/24/09 11:54:48 (10 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Fix and uniform the usage of Graph and Parent typedefs (#268)

  • Rename Graph typedefs to GraphType? in the implementation of graph maps and MapExtender? to prevent conflicts (especially using VS). They are not public.
  • Make Parent typedefs private in all classes.
  • Replace Digraph with Graph in some places (fix faulty renamings of the script).
  • Use Graph and Digraph typedefs (more) consequently.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/edge_set.h

    r559 r617  
    3434  public:
    3535
    36     typedef GR Graph;
    3736    typedef typename GR::Node Node;
    3837    typedef typename GR::NodeIt NodeIt;
     
    209208    template <typename V>
    210209    class NodeMap : public GR::template NodeMap<V> {
     210      typedef typename GR::template NodeMap<V> Parent;
     211
    211212    public:
    212 
    213       typedef typename GR::template NodeMap<V> Parent;
    214213
    215214      explicit NodeMap(const ListArcSetBase<GR>& arcset)
     
    260259  template <typename GR>
    261260  class ListArcSet : public ArcSetExtender<ListArcSetBase<GR> > {
    262 
    263   public:
    264 
    265261    typedef ArcSetExtender<ListArcSetBase<GR> > Parent;
     262
     263  public:
    266264
    267265    typedef typename Parent::Node Node;
    268266    typedef typename Parent::Arc Arc;
    269 
    270     typedef GR Graph;
    271 
    272267
    273268    typedef typename Parent::NodesImplBase NodesImplBase;
     
    293288
    294289    class NodesImpl : public NodesImplBase {
     290      typedef NodesImplBase Parent;
     291
    295292    public:
    296       typedef NodesImplBase Parent;
    297 
    298293      NodesImpl(const GR& graph, ListArcSet& arcset)
    299294        : Parent(graph), _arcset(arcset) {}
     
    355350  public:
    356351
    357     typedef GR Graph;
    358352    typedef typename GR::Node Node;
    359353    typedef typename GR::NodeIt NodeIt;
     
    638632    template <typename V>
    639633    class NodeMap : public GR::template NodeMap<V> {
     634      typedef typename GR::template NodeMap<V> Parent;
     635
    640636    public:
    641 
    642       typedef typename GR::template NodeMap<V> Parent;
    643637
    644638      explicit NodeMap(const ListEdgeSetBase<GR>& arcset)
     
    689683  template <typename GR>
    690684  class ListEdgeSet : public EdgeSetExtender<ListEdgeSetBase<GR> > {
    691 
    692   public:
    693 
    694685    typedef EdgeSetExtender<ListEdgeSetBase<GR> > Parent;
     686
     687  public:
    695688
    696689    typedef typename Parent::Node Node;
    697690    typedef typename Parent::Arc Arc;
    698691    typedef typename Parent::Edge Edge;
    699 
    700     typedef GR Graph;
    701 
    702692
    703693    typedef typename Parent::NodesImplBase NodesImplBase;
     
    718708
    719709    class NodesImpl : public NodesImplBase {
     710      typedef NodesImplBase Parent;
     711
    720712    public:
    721       typedef NodesImplBase Parent;
    722 
    723713      NodesImpl(const GR& graph, ListEdgeSet& arcset)
    724714        : Parent(graph), _arcset(arcset) {}
     
    780770  public:
    781771
    782     typedef GR Graph;
    783     typedef typename Graph::Node Node;
    784     typedef typename Graph::NodeIt NodeIt;
     772    typedef typename GR::Node Node;
     773    typedef typename GR::NodeIt NodeIt;
    785774
    786775  protected:
     
    901890    template <typename V>
    902891    class NodeMap : public GR::template NodeMap<V> {
     892      typedef typename GR::template NodeMap<V> Parent;
     893
    903894    public:
    904 
    905       typedef typename GR::template NodeMap<V> Parent;
    906895
    907896      explicit NodeMap(const SmartArcSetBase<GR>& arcset)
     
    957946  template <typename GR>
    958947  class SmartArcSet : public ArcSetExtender<SmartArcSetBase<GR> > {
    959 
    960   public:
    961 
    962948    typedef ArcSetExtender<SmartArcSetBase<GR> > Parent;
     949
     950  public:
    963951
    964952    typedef typename Parent::Node Node;
    965953    typedef typename Parent::Arc Arc;
    966 
    967     typedef GR Graph;
    968954
    969955  protected:
     
    984970
    985971    class NodesImpl : public NodesImplBase {
     972      typedef NodesImplBase Parent;
     973
    986974    public:
    987       typedef NodesImplBase Parent;
    988 
    989975      NodesImpl(const GR& graph, SmartArcSet& arcset)
    990976        : Parent(graph), _arcset(arcset) {}
     
    10631049  public:
    10641050
    1065     typedef GR Graph;
    10661051    typedef typename GR::Node Node;
    10671052    typedef typename GR::NodeIt NodeIt;
     
    12501235    template <typename V>
    12511236    class NodeMap : public GR::template NodeMap<V> {
     1237      typedef typename GR::template NodeMap<V> Parent;
     1238
    12521239    public:
    1253 
    1254       typedef typename GR::template NodeMap<V> Parent;
    12551240
    12561241      explicit NodeMap(const SmartEdgeSetBase<GR>& arcset)
     
    13051290  template <typename GR>
    13061291  class SmartEdgeSet : public EdgeSetExtender<SmartEdgeSetBase<GR> > {
    1307 
    1308   public:
    1309 
    13101292    typedef EdgeSetExtender<SmartEdgeSetBase<GR> > Parent;
     1293
     1294  public:
    13111295
    13121296    typedef typename Parent::Node Node;
     
    13141298    typedef typename Parent::Edge Edge;
    13151299
    1316     typedef GR Graph;
    1317 
    13181300  protected:
    13191301
     
    13321314
    13331315    class NodesImpl : public NodesImplBase {
     1316      typedef NodesImplBase Parent;
     1317
    13341318    public:
    1335       typedef NodesImplBase Parent;
    1336 
    13371319      NodesImpl(const GR& graph, SmartEdgeSet& arcset)
    13381320        : Parent(graph), _arcset(arcset) {}
Note: See TracChangeset for help on using the changeset viewer.