COIN-OR::LEMON - Graph Library

Changeset 595:e10b5e9419ef in lemon-0.x for src/work/deba/map_base.h


Ignore:
Timestamp:
05/10/04 15:49:35 (20 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@775
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/deba/map_base.h

    r571 r595  
    22#define MAP_BASE_H
    33
     4using namespace std;
     5
    46/**
    5         Template base class for implementing mapping on nodes.
    6         \param The first template parameter is the Graph class. The Graph
    7                 must have an \emp node_maps member with \emp MapRegistry class.
    8         \param The second template parameter is the  type of the class.
    9        
     7        Template base class for implementing mapping on nodes and edges.
     8        \param The first template parameter is the Graph class.
     9        \param The second template parameter is the key type.
     10        \param The third template parameter is an iterator on
     11                the keys.
    1012*/
    1113
     
    2527                typedef G Graph;
    2628                typedef MapRegistry<G, K, KIt> Registry;
    27                 typedef K KeyType;
     29                typedef K Key;
    2830                typedef KIt KeyIt;
    2931       
     
    3436                */     
    3537               
    36                 MapBase() : registry(0) {}
     38                MapBase() : graph(0), registry(0) {}
    3739
    3840                /**
     
    4143       
    4244                MapBase(Graph& g, Registry& r) : graph(&g), registry(0) {
    43                         registry->attach(*this);
     45                        r.attach(*this);
    4446                }
    4547
     
    8183        protected:
    8284               
     85                Graph* graph;
    8386                Registry* registry;
    84                 Graph* graph;
    8587
    8688                int registry_index;
    8789       
    8890                /**
    89                         Helper function to implement the default constructor in the subclasses.
     91                        Helper function to implement constructors in the subclasses.
    9092                */
    9193       
    9294                virtual void init() {
    93 
    9495                        for (KeyIt it(*graph); graph->valid(it); graph->next(it)) {
    9596                                add(it);
     
    112113                */
    113114       
    114                 virtual void add(const KeyType&) = 0;
    115        
     115                virtual void add(const Key&) = 0;       
    116116                /**
    117117                        The erase member function should be overloaded in the subclasses.
     
    119119                */
    120120       
    121                 virtual void erase(const KeyType&) = 0;
     121                virtual void erase(const Key&) = 0;
    122122       
    123123                /**
Note: See TracChangeset for help on using the changeset viewer.