COIN-OR::LEMON - Graph Library

Changeset 987:87f7c54892df in lemon-0.x for src/lemon/concept/maps.h


Ignore:
Timestamp:
11/13/04 18:07:10 (17 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1377
Message:

Naming changes:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/concept/maps.h

    r959 r987  
    3737    public:
    3838      /// Map's key type.
    39       typedef K KeyType;   
    40       /// Map's value type. (The type of objects associated with the keys).
    41       typedef T ValueType;
     39      typedef K Key;   
     40      /// Map's value type. (The type of objects associated with the keys).
     41      typedef T Value;
    4242
    4343      /// Returns the value associated with a key.
    44       ValueType operator[](const KeyType &k) const {return ValueType();}
     44      Value operator[](const Key &k) const {return Value();}
    4545
    4646      ///Default constructor
     
    5555    public:
    5656      /// Map's key type.
    57       typedef K KeyType;   
    58       /// Map's value type. (The type of objects associated with the keys).
    59       typedef T ValueType;
     57      typedef K Key;   
     58      /// Map's value type. (The type of objects associated with the keys).
     59      typedef T Value;
    6060
    6161      /// Sets the value associated with a key.
    62       void set(const KeyType &k,const ValueType &t) {}
     62      void set(const Key &k,const Value &t) {}
    6363
    6464      ///Default constructor
     
    7373    public:
    7474      /// Map's key type.
    75       typedef K KeyType;   
    76       /// Map's value type. (The type of objects associated with the keys).
    77       typedef T ValueType;
     75      typedef K Key;   
     76      /// Map's value type. (The type of objects associated with the keys).
     77      typedef T Value;
    7878
    7979      /// Returns the value associated with a key.
    80       ValueType operator[](const KeyType &k) const {return ValueType();}
     80      Value operator[](const Key &k) const {return Value();}
    8181      /// Sets the value associated with a key.
    82       void set(const KeyType &k,const ValueType &t) {}
     82      void set(const Key &k,const Value &t) {}
    8383
    8484      ///Default constructor
     
    9393    public:
    9494      /// Map's key type.
    95       typedef K KeyType;   
    96       /// Map's value type. (The type of objects associated with the keys).
    97       typedef T ValueType;
     95      typedef K Key;   
     96      /// Map's value type. (The type of objects associated with the keys).
     97      typedef T Value;
    9898
    9999    protected:
    100       ValueType tmp;
    101     public:
    102       typedef ValueType& ReferenceType;
     100      Value tmp;
     101    public:
     102      typedef Value& Reference;
    103103      /// Map's const reference type.
    104       typedef const ValueType& ConstReferenceType;
     104      typedef const Value& ConstReference;
    105105
    106106      ///Returns a reference to the value associated to a key.
    107       ReferenceType operator[](const KeyType &i) { return tmp; }
     107      Reference operator[](const Key &i) { return tmp; }
    108108      ///Returns a const reference to the value associated to a key.
    109       ConstReferenceType operator[](const KeyType &i) const
     109      ConstReference operator[](const Key &i) const
    110110      { return tmp; }
    111111      /// Sets the value associated with a key.
    112       void set(const KeyType &k,const ValueType &t) { operator[](k)=t; }
     112      void set(const Key &k,const Value &t) { operator[](k)=t; }
    113113
    114114      ///Default constructor
     
    150150    template<typename ReadMap>
    151151    struct ReadMapConcept {
    152       typedef typename ReadMap::KeyType KeyType;
    153       typedef typename ReadMap::ValueType ValueType;
     152      typedef typename ReadMap::Key Key;
     153      typedef typename ReadMap::Value Value;
    154154
    155155      void constraints() {
    156156        // No constraints for constructor.
    157157
    158         // What are the requirement for the ValueType?
     158        // What are the requirement for the Value?
    159159        // CopyConstructible? Assignable? None of these?
    160         ValueType v = m[k];
     160        Value v = m[k];
    161161        v = m[k];
    162162
     
    166166
    167167      ReadMap m;
    168       KeyType k;
     168      Key k;
    169169    };
    170170
    171171    template<typename WriteMap>
    172172    struct WriteMapConcept {
    173       typedef typename WriteMap::KeyType KeyType;
    174       typedef typename WriteMap::ValueType ValueType;
     173      typedef typename WriteMap::Key Key;
     174      typedef typename WriteMap::Value Value;
    175175
    176176      void constraints() {
     
    181181
    182182      WriteMap m;
    183       KeyType k;
    184       ValueType v;
     183      Key k;
     184      Value v;
    185185    };
    186186
     
    195195    template<typename ReferenceMap>
    196196    struct ReferenceMapConcept {
    197       typedef typename ReferenceMap::KeyType KeyType;
    198       typedef typename ReferenceMap::ValueType ValueType;
    199       typedef typename ReferenceMap::ReferenceType ReferenceType;
     197      typedef typename ReferenceMap::Key Key;
     198      typedef typename ReferenceMap::Value Value;
     199      typedef typename ReferenceMap::Reference Reference;
    200200
    201201      // What for is this?
    202       typedef typename ReferenceMap::ConstReferenceType ConstReferenceType;
     202      typedef typename ReferenceMap::ConstReference ConstReference;
    203203
    204204      void constraints() {
     
    208208        // Or should we require real reference?
    209209        // Like this:
    210         // ValueType &vv = m[k];
     210        // Value &vv = m[k];
    211211        // ignore_unused_variable_warning(vv);
    212212      }
    213213
    214214      ReferenceMap m;
    215       KeyType k;
    216       ValueType v;
     215      Key k;
     216      Value v;
    217217    };
    218218
     
    236236      const GraphMap &c;
    237237      const Graph &g;
    238       const typename GraphMap::ValueType &t;
     238      const typename GraphMap::Value &t;
    239239    };
    240240   
Note: See TracChangeset for help on using the changeset viewer.