COIN-OR::LEMON - Graph Library

Changeset 786:d7b3b13b9df6 in lemon-0.x for src/hugo/vector_map_factory.h


Ignore:
Timestamp:
09/02/04 17:21:13 (16 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1079
Message:

Change 'Key' to 'KeyType?' (possibly temporarily).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/vector_map_factory.h

    r785 r786  
    3131    typedef typename MapRegistry::Graph Graph;
    3232    /// The key type of the maps.
    33     typedef typename MapRegistry::Key Key;
     33    typedef typename MapRegistry::KeyType KeyType;
    3434    /// The iterator to iterate on the keys.
    3535    typedef typename MapRegistry::KeyIt KeyIt;
     
    113113       * actual keys of the graph.
    114114       */
    115       typename Container::reference operator[](const Key& key) {
     115      typename Container::reference operator[](const KeyType& key) {
    116116        int id = getGraph()->id(key);
    117117        return container[id];
     
    122122       * actual keys of the graph.
    123123       */
    124       typename Container::const_reference operator[](const Key& key) const {
     124      typename Container::const_reference operator[](const KeyType& key) const {
    125125        int id = getGraph()->id(key);
    126126        return container[id];
     
    130130       *  This is a compatibility feature with the not dereferable maps.
    131131       */
    132       void set(const Key& key, const Value& val) {
     132      void set(const KeyType& key, const Value& val) {
    133133        int id = getGraph()->id(key);
    134134        container[id] = val;
     
    137137      /** Add a new key to the map. It called by the map registry.
    138138       */
    139       void add(const Key& key) {
     139      void add(const KeyType& key) {
    140140        int id = getGraph()->id(key);
    141141        if (id >= container.size()) {
     
    146146      /** Erase a key from the map. It called by the map registry.
    147147       */
    148       void erase(const Key& key) {}
     148      void erase(const KeyType& key) {}
    149149
    150150      /** Clear the data structure.
     
    173173        iterator() {}
    174174
    175         typedef extended_pair<const Key&, const Key&,
     175        typedef extended_pair<const KeyType&, const KeyType&,
    176176                              Value&, Value&> Reference;
    177177
     
    186186        private:
    187187          Reference data;
    188           Pointer(const Key& key, Value& val) : data(key, val) {}
     188          Pointer(const KeyType& key, Value& val) : data(key, val) {}
    189189        public:
    190190          Reference* operator->() {return &data;}
     
    263263        const_iterator(iterator p_it) : map(p_it.map), it(p_it.it) {}
    264264     
    265         typedef extended_pair<const Key&, const Key&,
     265        typedef extended_pair<const KeyType&, const KeyType&,
    266266          const Value&, const Value&> Reference;
    267267
     
    277277        private:
    278278          Reference data;
    279           Pointer(const Key& key, const Value& val) : data(key, val) {}
     279          Pointer(const KeyType& key, const Value& val) : data(key, val) {}
    280280        public:
    281281          Reference* operator->() {return &data;}
Note: See TracChangeset for help on using the changeset viewer.