Improve docs.
     5 #include <hugo/extended_pair.h>
 
    10   template <typename Map>
 
    13   template <typename Map>
 
    14   class MapConstIterator;
 
    16   /** Compatible iterator with the stl maps' iterators.
 
    17    *  It iterates on pairs of a key and a value.
 
    19   template <typename Map>  
 
    22     friend class MapConstIterator<Map>;
 
    26     /// The key type of the iterator.
 
    27     typedef typename Map::KeyType KeyType;
 
    28     /// The iterator to iterate on the keys.
 
    29     typedef typename Map::KeyIt KeyIt;
 
    31     /// The value type of the iterator.
 
    32     typedef typename Map::ValueType ValueType;
 
    33     /// The reference type of the iterator.
 
    34     typedef typename Map::ReferenceType ReferenceType;
 
    35     /// The pointer type of the iterator.
 
    36     typedef typename Map::PointerType PointerType;
 
    38     /// The const value type of the iterator.
 
    39     typedef typename Map::ConstValueType ConstValueType;
 
    40     /// The const reference type of the iterator.
 
    41     typedef typename Map::ConstReferenceType ConstReferenceType;
 
    42     /// The pointer type of the iterator.
 
    43     typedef typename Map::ConstPointerType ConstPointerType;
 
    47     /** Constructor to initalize the the iterators returned
 
    48      *  by the begin() and end().
 
    50     MapIterator (Map& pmap, const KeyIt& pit) 
 
    51       : map(&pmap), it(pit) {}
 
    55     /** Default constructor. 
 
    59     typedef extended_pair<const KeyType&, const KeyType&, 
 
    60       ReferenceType, ReferenceType> PairReferenceType;
 
    62     /** Dereference operator for map.
 
    64     PairReferenceType operator*() {
 
    65       return PairReferenceType(it, (*map)[it]);
 
    68     class PairPointerType {
 
    69       friend class MapIterator;
 
    71       PairReferenceType data;
 
    72       PairPointerType(const KeyType& key, ReferenceType val) 
 
    75       PairReferenceType* operator->() {return &data;}
 
    78     /** Arrow operator for map.
 
    80     PairPointerType operator->() {
 
    81       return PairPointerType(it, ((*map)[it])); 
 
    84     /** The pre increment operator of the map.
 
    86     MapIterator& operator++() { 
 
    91     /** The post increment operator of the map.
 
    93     MapIterator operator++(int) { 
 
    99     /** The equality operator of the map.
 
   101     bool operator==(const MapIterator& p_it) const {
 
   102       return p_it.it == it;
 
   105     /** The not-equality operator of the map.
 
   107     bool operator!=(const MapIterator& p_it) const {
 
   108       return !(*this == p_it);
 
   111     /** The equality operator of the map.
 
   113     bool operator==(const MapConstIterator<Map>& p_it) const {
 
   114       return p_it.it == it;
 
   117     /** The not-equality operator of the map.
 
   119     bool operator!=(const MapConstIterator<Map>& p_it) const {
 
   120       return !(*this == p_it);
 
   128   /** Compatible iterator with the stl maps' iterators.
 
   129    *  It iterates on pairs of a key and a value.
 
   131   template <typename Map>
 
   132   class MapConstIterator {
 
   134     friend class MapIterator<Map>;
 
   138     /// The key type of the iterator.
 
   139     typedef typename Map::KeyType KeyType;
 
   140     /// The iterator to iterate on the keys.
 
   141     typedef typename Map::KeyIt KeyIt;
 
   143     /// The value type of the iterator.
 
   144     typedef typename Map::ValueType ValueType;
 
   145     /// The reference type of the iterator.
 
   146     typedef typename Map::ReferenceType ReferenceType;
 
   147     /// The pointer type of the iterator.
 
   148     typedef typename Map::PointerType PointerType;
 
   150     /// The const value type of the iterator.
 
   151     typedef typename Map::ConstValueType ConstValueType;
 
   152     /// The const reference type of the iterator.
 
   153     typedef typename Map::ConstReferenceType ConstReferenceType;
 
   154     /// The pointer type of the iterator.
 
   155     typedef typename Map::ConstPointerType ConstPointerType;
 
   159     /** Constructor to initalize the the iterators returned
 
   160      *  by the begin() and end().
 
   163     MapConstIterator (const Map& pmap, const KeyIt& pit) 
 
   164       : map(&pmap), it(pit) {}
 
   168     /** Default constructor. 
 
   170     MapConstIterator() {}
 
   172     typedef extended_pair<const KeyType&, const KeyType&, 
 
   173       ConstReferenceType, ConstReferenceType> PairReferenceType;
 
   175     /** Dereference operator for map.
 
   177     PairReferenceType operator*() {
 
   178       return PairReferenceType(it, (*map)[it]);
 
   181     class PairPointerType {
 
   182       friend class MapConstIterator;
 
   184       PairReferenceType data;
 
   185       PairPointerType(const KeyType& key, ConstReferenceType val) 
 
   188       PairReferenceType* operator->() {return &data;}
 
   191     /** Arrow operator for map.
 
   193     PairPointerType operator->() {
 
   194       return PairPointerType(it, ((*map)[it])); 
 
   197     /** The pre increment operator of the map.
 
   199     MapConstIterator& operator++() { 
 
   204     /** The post increment operator of the map.
 
   206     MapConstIterator operator++(int) { 
 
   207       MapConstIterator<Map> tmp(it); 
 
   212     /** The equality operator of the map.
 
   214     bool operator==(const MapIterator<Map>& p_it) const {
 
   215       return p_it.it == it;
 
   218     /** The not-equality operator of the map.
 
   220     bool operator!=(const MapIterator<Map>& p_it) const {
 
   221       return !(*this == p_it);
 
   224     /** The equality operator of the map.
 
   226     bool operator==(const MapConstIterator& p_it) const {
 
   227       return p_it.it == it;
 
   230     /** The not-equality operator of the map.
 
   232     bool operator!=(const MapConstIterator& p_it) const {
 
   233       return !(*this == p_it);