lemon/bits/map_extender.h
changeset 2384 805c5a2a36dd
parent 2260 4274224f8a7d
child 2391 14a343be7a5a
equal deleted inserted replaced
9:8a85e9a5aa46 10:26700e30a516
    81       MapIt() {}
    81       MapIt() {}
    82 
    82 
    83       MapIt(Invalid i) : Parent(i) { }
    83       MapIt(Invalid i) : Parent(i) { }
    84 
    84 
    85       explicit MapIt(Map& _map) : map(_map) {
    85       explicit MapIt(Map& _map) : map(_map) {
    86         map.getNotifier()->first(*this);
    86         map.notifier()->first(*this);
    87       }
    87       }
    88 
    88 
    89       MapIt(const Map& _map, const Item& item) 
    89       MapIt(const Map& _map, const Item& item) 
    90 	: Parent(item), map(_map) {}
    90 	: Parent(item), map(_map) {}
    91 
    91 
    92       MapIt& operator++() { 
    92       MapIt& operator++() { 
    93 	map.getNotifier()->next(*this);
    93 	map.notifier()->next(*this);
    94 	return *this; 
    94 	return *this; 
    95       }
    95       }
    96       
    96       
    97       typename MapTraits<Map>::ConstReturnValue operator*() const {
    97       typename MapTraits<Map>::ConstReturnValue operator*() const {
    98 	return map[*this];
    98 	return map[*this];
   121       ConstMapIt() {}
   121       ConstMapIt() {}
   122 
   122 
   123       ConstMapIt(Invalid i) : Parent(i) { }
   123       ConstMapIt(Invalid i) : Parent(i) { }
   124 
   124 
   125       explicit ConstMapIt(Map& _map) : map(_map) {
   125       explicit ConstMapIt(Map& _map) : map(_map) {
   126         map.getNotifier()->first(*this);
   126         map.notifier()->first(*this);
   127       }
   127       }
   128 
   128 
   129       ConstMapIt(const Map& _map, const Item& item) 
   129       ConstMapIt(const Map& _map, const Item& item) 
   130 	: Parent(item), map(_map) {}
   130 	: Parent(item), map(_map) {}
   131 
   131 
   132       ConstMapIt& operator++() { 
   132       ConstMapIt& operator++() { 
   133 	map.getNotifier()->next(*this);
   133 	map.notifier()->next(*this);
   134 	return *this; 
   134 	return *this; 
   135       }
   135       }
   136 
   136 
   137       typename MapTraits<Map>::ConstReturnValue operator*() const {
   137       typename MapTraits<Map>::ConstReturnValue operator*() const {
   138 	return map[*this];
   138 	return map[*this];
   150       ItemIt() {}
   150       ItemIt() {}
   151 
   151 
   152       ItemIt(Invalid i) : Parent(i) { }
   152       ItemIt(Invalid i) : Parent(i) { }
   153 
   153 
   154       explicit ItemIt(Map& _map) : map(_map) {
   154       explicit ItemIt(Map& _map) : map(_map) {
   155         map.getNotifier()->first(*this);
   155         map.notifier()->first(*this);
   156       }
   156       }
   157 
   157 
   158       ItemIt(const Map& _map, const Item& item) 
   158       ItemIt(const Map& _map, const Item& item) 
   159 	: Parent(item), map(_map) {}
   159 	: Parent(item), map(_map) {}
   160 
   160 
   161       ItemIt& operator++() { 
   161       ItemIt& operator++() { 
   162 	map.getNotifier()->next(*this);
   162 	map.notifier()->next(*this);
   163 	return *this; 
   163 	return *this; 
   164       }
   164       }
   165 
   165 
   166     protected:
   166     protected:
   167       const Map& map;
   167       const Map& map;