COIN-OR::LEMON - Graph Library

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


Ignore:
Timestamp:
11/13/04 18:07:10 (15 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/map_iterator.h

    r921 r987  
    4242
    4343    /// The key type of the iterator.
    44     typedef typename Map::KeyType KeyType;
    45     /// The iterator to iterate on the keys.
    46     typedef typename Map::KeyIt KeyIt;
    47 
    48     /// The value type of the iterator.
    49     typedef typename Map::ValueType ValueType;
    50     /// The reference type of the iterator.
    51     typedef typename Map::ReferenceType ReferenceType;
    52     /// The pointer type of the iterator.
    53     typedef typename Map::PointerType PointerType;
    54 
    55     /// The const value type of the iterator.
    56     typedef typename Map::ConstValueType ConstValueType;
    57     /// The const reference type of the iterator.
    58     typedef typename Map::ConstReferenceType ConstReferenceType;
    59     /// The pointer type of the iterator.
    60     typedef typename Map::ConstPointerType ConstPointerType;
     44    typedef typename Map::Key Key;
     45    /// The iterator to iterate on the keys.
     46    typedef typename Map::KeyIt KeyIt;
     47
     48    /// The value type of the iterator.
     49    typedef typename Map::Value Value;
     50    /// The reference type of the iterator.
     51    typedef typename Map::Reference Reference;
     52    /// The pointer type of the iterator.
     53    typedef typename Map::Pointer Pointer;
     54
     55    /// The const value type of the iterator.
     56    typedef typename Map::ConstValue ConstValue;
     57    /// The const reference type of the iterator.
     58    typedef typename Map::ConstReference ConstReference;
     59    /// The pointer type of the iterator.
     60    typedef typename Map::ConstPointer ConstPointer;
    6161
    6262  protected:
     
    105105
    106106    /// The key type of the iterator.
    107     typedef typename Map::KeyType KeyType;
    108     /// The iterator to iterate on the keys.
    109     typedef typename Map::KeyIt KeyIt;
    110 
    111     /// The value type of the iterator.
    112     typedef typename Map::ValueType ValueType;
    113     /// The reference type of the iterator.
    114     typedef typename Map::ReferenceType ReferenceType;
    115     /// The pointer type of the iterator.
    116     typedef typename Map::PointerType PointerType;
    117 
    118     /// The const value type of the iterator.
    119     typedef typename Map::ConstValueType ConstValueType;
    120     /// The const reference type of the iterator.
    121     typedef typename Map::ConstReferenceType ConstReferenceType;
    122     /// The pointer type of the iterator.
    123     typedef typename Map::ConstPointerType ConstPointerType;
     107    typedef typename Map::Key Key;
     108    /// The iterator to iterate on the keys.
     109    typedef typename Map::KeyIt KeyIt;
     110
     111    /// The value type of the iterator.
     112    typedef typename Map::Value Value;
     113    /// The reference type of the iterator.
     114    typedef typename Map::Reference Reference;
     115    /// The pointer type of the iterator.
     116    typedef typename Map::Pointer Pointer;
     117
     118    /// The const value type of the iterator.
     119    typedef typename Map::ConstValue ConstValue;
     120    /// The const reference type of the iterator.
     121    typedef typename Map::ConstReference ConstReference;
     122    /// The pointer type of the iterator.
     123    typedef typename Map::ConstPointer ConstPointer;
    124124   
    125125  public:
    126126
    127127    /// The value type of the iterator.
    128     typedef extended_pair<KeyType, const KeyType&,
    129       ValueType, const ValueType&> PairValueType;
     128    typedef extended_pair<Key, const Key&,
     129      Value, const Value&> PairValue;
    130130
    131131    /// The reference type of the iterator.
    132     typedef extended_pair<const KeyType&, const KeyType&,
    133       ReferenceType, ReferenceType> PairReferenceType;
     132    typedef extended_pair<const Key&, const Key&,
     133      Reference, Reference> PairReference;
    134134
    135135    /// Default constructor.
     
    141141
    142142    /// Dereference operator for the iterator.
    143     PairReferenceType operator*() {
    144       return PairReferenceType(Base::it, (*map)[Base::it]);
    145     }
    146 
    147     /// The pointer type of the iterator.
    148     class PairPointerType {
     143    PairReference operator*() {
     144      return PairReference(Base::it, (*map)[Base::it]);
     145    }
     146
     147    /// The pointer type of the iterator.
     148    class PairPointer {
    149149      friend class MapIterator;
    150150    private:
    151       PairReferenceType data;
    152       PairPointerType(const KeyType& key, ReferenceType val)
     151      PairReference data;
     152      PairPointer(const Key& key, Reference val)
    153153        : data(key, val) {}
    154154    public:
    155       PairReferenceType* operator->() {return &data;}
     155      PairReference* operator->() {return &data;}
    156156    };
    157157
    158158    /// Arrow operator for the iterator.
    159     PairPointerType operator->() {
    160       return PairPointerType(Base::it, ((*map)[Base::it]));
     159    PairPointer operator->() {
     160      return PairPointer(Base::it, ((*map)[Base::it]));
    161161    }
    162162       
     
    181181    typedef std::forward_iterator_tag iterator_category;
    182182    typedef int difference_type;
    183     typedef PairValueType value_type;
    184     typedef PairReferenceType reference;
    185     typedef PairPointerType pointer;
     183    typedef PairValue value_type;
     184    typedef PairReference reference;
     185    typedef PairPointer pointer;
    186186  };
    187187
     
    198198
    199199    /// The key type of the iterator.
    200     typedef typename Map::KeyType KeyType;
    201     /// The iterator to iterate on the keys.
    202     typedef typename Map::KeyIt KeyIt;
    203 
    204     /// The value type of the iterator.
    205     typedef typename Map::ValueType ValueType;
    206     /// The reference type of the iterator.
    207     typedef typename Map::ReferenceType ReferenceType;
    208     /// The pointer type of the iterator.
    209     typedef typename Map::PointerType PointerType;
    210 
    211     /// The const value type of the iterator.
    212     typedef typename Map::ConstValueType ConstValueType;
    213     /// The const reference type of the iterator.
    214     typedef typename Map::ConstReferenceType ConstReferenceType;
    215     /// The pointer type of the iterator.
    216     typedef typename Map::ConstPointerType ConstPointerType;
     200    typedef typename Map::Key Key;
     201    /// The iterator to iterate on the keys.
     202    typedef typename Map::KeyIt KeyIt;
     203
     204    /// The value type of the iterator.
     205    typedef typename Map::Value Value;
     206    /// The reference type of the iterator.
     207    typedef typename Map::Reference Reference;
     208    /// The pointer type of the iterator.
     209    typedef typename Map::Pointer Pointer;
     210
     211    /// The const value type of the iterator.
     212    typedef typename Map::ConstValue ConstValue;
     213    /// The const reference type of the iterator.
     214    typedef typename Map::ConstReference ConstReference;
     215    /// The pointer type of the iterator.
     216    typedef typename Map::ConstPointer ConstPointer;
    217217
    218218  public:   
     
    233233
    234234    /// The value type of the iterator.
    235     typedef extended_pair<KeyType, const KeyType&,
    236       ValueType, const ValueType&> PairValueType;
     235    typedef extended_pair<Key, const Key&,
     236      Value, const Value&> PairValue;
    237237
    238238    /// The reference type of map.
    239     typedef extended_pair<const KeyType&, const KeyType&,
    240       ConstReferenceType, ConstReferenceType> PairReferenceType;
     239    typedef extended_pair<const Key&, const Key&,
     240      ConstReference, ConstReference> PairReference;
    241241
    242242    /// Dereference operator for the iterator.
    243     PairReferenceType operator*() {
    244       return PairReferenceType(Base::it, (*map)[Base::it]);
    245     }
    246 
    247     /// The pointer type of the iterator.
    248     class PairPointerType {
     243    PairReference operator*() {
     244      return PairReference(Base::it, (*map)[Base::it]);
     245    }
     246
     247    /// The pointer type of the iterator.
     248    class PairPointer {
    249249      friend class MapConstIterator;
    250250    private:
    251       PairReferenceType data;
    252       PairPointerType(const KeyType& key, ConstReferenceType val)
     251      PairReference data;
     252      PairPointer(const Key& key, ConstReference val)
    253253        : data(key, val) {}
    254254    public:
    255       PairReferenceType* operator->() {return &data;}
     255      PairReference* operator->() {return &data;}
    256256    };
    257257
    258258    /// Arrow operator for the iterator.
    259     PairPointerType operator->() {
    260       return PairPointerType(Base::it, (*map)[Base::it]);
     259    PairPointer operator->() {
     260      return PairPointer(Base::it, (*map)[Base::it]);
    261261    }
    262262
     
    281281    typedef std::input_iterator_tag iterator_category;
    282282    typedef int difference_type;
    283     typedef PairValueType value_type;
    284     typedef PairReferenceType reference;
    285     typedef PairPointerType pointer;
     283    typedef PairValue value_type;
     284    typedef PairReference reference;
     285    typedef PairPointer pointer;
    286286  };
    287287
     
    298298 
    299299    /// The key type of the iterator.
    300     typedef typename Map::KeyType KeyType;
     300    typedef typename Map::Key Key;
    301301    /// The iterator to iterate on the keys.
    302302    typedef typename Map::KeyIt KeyIt;
     
    324324
    325325    /// The dereferencing operator of the iterator.
    326     KeyType operator*() const {
    327       return static_cast<KeyType>(Base::it);
     326    Key operator*() const {
     327      return static_cast<Key>(Base::it);
    328328    }
    329329
     
    332332    typedef std::input_iterator_tag iterator_category;
    333333    typedef int difference_type;
    334     typedef KeyType value_type;
    335     typedef const KeyType& reference;
    336     typedef const KeyType* pointer;
     334    typedef Key value_type;
     335    typedef const Key& reference;
     336    typedef const Key* pointer;
    337337  };
    338338
     
    353353
    354354    /// The key type of the iterator.
    355     typedef typename Map::KeyType KeyType;
    356     /// The iterator to iterate on the keys.
    357     typedef typename Map::KeyIt KeyIt;
    358 
    359 
    360     /// The value type of the iterator.
    361     typedef typename Map::ValueType ValueType;
    362     /// The reference type of the iterator.
    363     typedef typename Map::ReferenceType ReferenceType;
    364     /// The pointer type of the iterator.
    365     typedef typename Map::PointerType PointerType;
    366 
    367     /// The const value type of the iterator.
    368     typedef typename Map::ConstValueType ConstValueType;
    369     /// The const reference type of the iterator.
    370     typedef typename Map::ConstReferenceType ConstReferenceType;
    371     /// The pointer type of the iterator.
    372     typedef typename Map::ConstPointerType ConstPointerType;
     355    typedef typename Map::Key Key;
     356    /// The iterator to iterate on the keys.
     357    typedef typename Map::KeyIt KeyIt;
     358
     359
     360    /// The value type of the iterator.
     361    typedef typename Map::Value Value;
     362    /// The reference type of the iterator.
     363    typedef typename Map::Reference Reference;
     364    /// The pointer type of the iterator.
     365    typedef typename Map::Pointer Pointer;
     366
     367    /// The const value type of the iterator.
     368    typedef typename Map::ConstValue ConstValue;
     369    /// The const reference type of the iterator.
     370    typedef typename Map::ConstReference ConstReference;
     371    /// The pointer type of the iterator.
     372    typedef typename Map::ConstPointer ConstPointer;
    373373
    374374  private:
     
    400400
    401401    /// The dereferencing operator of the iterator.
    402     ReferenceType operator*() const {
     402    Reference operator*() const {
    403403      return (*map)[Base::it];
    404404    }
    405405
    406406    /// The arrow operator of the iterator.
    407     PointerType operator->() const {
     407    Pointer operator->() const {
    408408      return &(operator*());
    409409    }
     
    413413    typedef std::forward_iterator_tag iterator_category;
    414414    typedef int difference_type;
    415     typedef ValueType value_type;
    416     typedef ReferenceType reference;
    417     typedef PointerType pointer;
     415    typedef Value value_type;
     416    typedef Reference reference;
     417    typedef Pointer pointer;
    418418  };
    419419
     
    431431
    432432    /// The key type of the iterator.
    433     typedef typename Map::KeyType KeyType;
    434     /// The iterator to iterate on the keys.
    435     typedef typename Map::KeyIt KeyIt;
    436 
    437     /// The value type of the iterator.
    438     typedef typename Map::ValueType ValueType;
    439     /// The reference type of the iterator.
    440     typedef typename Map::ReferenceType ReferenceType;
    441     /// The pointer type of the iterator.
    442     typedef typename Map::PointerType PointerType;
    443 
    444     /// The const value type of the iterator.
    445     typedef typename Map::ConstValueType ConstValueType;
    446     /// The const reference type of the iterator.
    447     typedef typename Map::ConstReferenceType ConstReferenceType;
    448     /// The pointer type of the iterator.
    449     typedef typename Map::ConstPointerType ConstPointerType;
     433    typedef typename Map::Key Key;
     434    /// The iterator to iterate on the keys.
     435    typedef typename Map::KeyIt KeyIt;
     436
     437    /// The value type of the iterator.
     438    typedef typename Map::Value Value;
     439    /// The reference type of the iterator.
     440    typedef typename Map::Reference Reference;
     441    /// The pointer type of the iterator.
     442    typedef typename Map::Pointer Pointer;
     443
     444    /// The const value type of the iterator.
     445    typedef typename Map::ConstValue ConstValue;
     446    /// The const reference type of the iterator.
     447    typedef typename Map::ConstReference ConstReference;
     448    /// The pointer type of the iterator.
     449    typedef typename Map::ConstPointer ConstPointer;
    450450
    451451  private:
     
    482482
    483483    /// The dereferencing operator of the iterator.
    484     ConstReferenceType operator*() const {
     484    ConstReference operator*() const {
    485485      return (*map)[Base::it];
    486486    }
    487487
    488488    /// The arrow operator of the iterator.
    489     ConstPointerType operator->() const {
     489    ConstPointer operator->() const {
    490490      return &(operator*());
    491491    }
     
    495495    typedef std::input_iterator_tag iterator_category;
    496496    typedef int difference_type;
    497     typedef ValueType value_type;
    498     typedef ConstReferenceType reference;
    499     typedef ConstPointerType pointer;
     497    typedef Value value_type;
     498    typedef ConstReference reference;
     499    typedef ConstPointer pointer;
    500500  };
    501501
     
    512512
    513513    /// The key type of the iterator.
    514     typedef typename Map::KeyType KeyType;
    515     /// The iterator to iterate on the keys.
    516     typedef typename Map::KeyIt KeyIt;
    517 
    518 
    519     /// The value type of the iterator.
    520     typedef typename Map::ValueType ValueType;
    521     /// The reference type of the iterator.
    522     typedef typename Map::ReferenceType ReferenceType;
    523     /// The pointer type of the iterator.
    524     typedef typename Map::PointerType PointerType;
    525 
    526     /// The const value type of the iterator.
    527     typedef typename Map::ConstValueType ConstValueType;
    528     /// The const reference type of the iterator.
    529     typedef typename Map::ConstReferenceType ConstReferenceType;
    530     /// The pointer type of the iterator.
    531     typedef typename Map::ConstPointerType ConstPointerType;
     514    typedef typename Map::Key Key;
     515    /// The iterator to iterate on the keys.
     516    typedef typename Map::KeyIt KeyIt;
     517
     518
     519    /// The value type of the iterator.
     520    typedef typename Map::Value Value;
     521    /// The reference type of the iterator.
     522    typedef typename Map::Reference Reference;
     523    /// The pointer type of the iterator.
     524    typedef typename Map::Pointer Pointer;
     525
     526    /// The const value type of the iterator.
     527    typedef typename Map::ConstValue ConstValue;
     528    /// The const reference type of the iterator.
     529    typedef typename Map::ConstReference ConstReference;
     530    /// The pointer type of the iterator.
     531    typedef typename Map::ConstPointer ConstPointer;
    532532
    533533    /// The map initialized const key set.
     
    549549  public:
    550550    // STL  compatibility typedefs.
    551     typedef ValueType value_type;
     551    typedef Value value_type;
    552552    typedef ConstIterator const_iterator;
    553     typedef ConstReferenceType const_reference;
    554     typedef ConstPointerType const_pointer;
     553    typedef ConstReference const_reference;
     554    typedef ConstPointer const_pointer;
    555555    typedef int difference_type;
    556556  };
     
    568568
    569569    /// The key type of the iterator.
    570     typedef typename Map::KeyType KeyType;
    571     /// The iterator to iterate on the keys.
    572     typedef typename Map::KeyIt KeyIt;
    573 
    574 
    575     /// The value type of the iterator.
    576     typedef typename Map::ValueType ValueType;
    577     /// The reference type of the iterator.
    578     typedef typename Map::ReferenceType ReferenceType;
    579     /// The pointer type of the iterator.
    580     typedef typename Map::PointerType PointerType;
    581 
    582     /// The const value type of the iterator.
    583     typedef typename Map::ConstValueType ConstValueType;
    584     /// The const reference type of the iterator.
    585     typedef typename Map::ConstReferenceType ConstReferenceType;
    586     /// The pointer type of the iterator.
    587     typedef typename Map::ConstPointerType ConstPointerType;
     570    typedef typename Map::Key Key;
     571    /// The iterator to iterate on the keys.
     572    typedef typename Map::KeyIt KeyIt;
     573
     574
     575    /// The value type of the iterator.
     576    typedef typename Map::Value Value;
     577    /// The reference type of the iterator.
     578    typedef typename Map::Reference Reference;
     579    /// The pointer type of the iterator.
     580    typedef typename Map::Pointer Pointer;
     581
     582    /// The const value type of the iterator.
     583    typedef typename Map::ConstValue ConstValue;
     584    /// The const reference type of the iterator.
     585    typedef typename Map::ConstReference ConstReference;
     586    /// The pointer type of the iterator.
     587    typedef typename Map::ConstPointer ConstPointer;
    588588
    589589    /// The map initialized const value set.
     
    605605  public:
    606606    // STL  compatibility typedefs.
    607     typedef ValueType value_type;
     607    typedef Value value_type;
    608608    typedef ConstIterator const_iterator;
    609     typedef ConstReferenceType const_reference;
    610     typedef ConstPointerType const_pointer;
     609    typedef ConstReference const_reference;
     610    typedef ConstPointer const_pointer;
    611611    typedef int difference_type;
    612612  };
     
    625625
    626626    /// The key type of the iterator.
    627     typedef typename Map::KeyType KeyType;
    628     /// The iterator to iterate on the keys.
    629     typedef typename Map::KeyIt KeyIt;
    630 
    631 
    632     /// The value type of the iterator.
    633     typedef typename Map::ValueType ValueType;
    634     /// The reference type of the iterator.
    635     typedef typename Map::ReferenceType ReferenceType;
    636     /// The pointer type of the iterator.
    637     typedef typename Map::PointerType PointerType;
    638 
    639     /// The const value type of the iterator.
    640     typedef typename Map::ConstValueType ConstValueType;
    641     /// The const reference type of the iterator.
    642     typedef typename Map::ConstReferenceType ConstReferenceType;
    643     /// The pointer type of the iterator.
    644     typedef typename Map::ConstPointerType ConstPointerType;
     627    typedef typename Map::Key Key;
     628    /// The iterator to iterate on the keys.
     629    typedef typename Map::KeyIt KeyIt;
     630
     631
     632    /// The value type of the iterator.
     633    typedef typename Map::Value Value;
     634    /// The reference type of the iterator.
     635    typedef typename Map::Reference Reference;
     636    /// The pointer type of the iterator.
     637    typedef typename Map::Pointer Pointer;
     638
     639    /// The const value type of the iterator.
     640    typedef typename Map::ConstValue ConstValue;
     641    /// The const reference type of the iterator.
     642    typedef typename Map::ConstReference ConstReference;
     643    /// The pointer type of the iterator.
     644    typedef typename Map::ConstPointer ConstPointer;
    645645
    646646    /// The map initialized value set.
     
    675675  public:
    676676    // STL  compatibility typedefs.
    677     typedef ValueType value_type;
     677    typedef Value value_type;
    678678    typedef Iterator iterator;
    679679    typedef ConstIterator const_iterator;
    680     typedef ReferenceType reference;
    681     typedef ConstReferenceType const_reference;
    682     typedef PointerType pointer;
    683     typedef ConstPointerType const_pointer;
     680    typedef Reference reference;
     681    typedef ConstReference const_reference;
     682    typedef Pointer pointer;
     683    typedef ConstPointer const_pointer;
    684684    typedef int difference_type;
    685685
Note: See TracChangeset for help on using the changeset viewer.