Changeset 987:87f7c54892df in lemon-0.x for src/lemon/map_iterator.h
- Timestamp:
- 11/13/04 18:07:10 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1377
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/map_iterator.h
r921 r987 42 42 43 43 /// The key type of the iterator. 44 typedef typename Map::Key Type 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::Value Type ValueType;50 /// The reference type of the iterator. 51 typedef typename Map::Reference Type ReferenceType;52 /// The pointer type of the iterator. 53 typedef typename Map::Pointer Type PointerType;54 55 /// The const value type of the iterator. 56 typedef typename Map::ConstValue Type ConstValueType;57 /// The const reference type of the iterator. 58 typedef typename Map::ConstReference Type ConstReferenceType;59 /// The pointer type of the iterator. 60 typedef typename Map::ConstPointer Type 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; 61 61 62 62 protected: … … 105 105 106 106 /// The key type of the iterator. 107 typedef typename Map::Key Type 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::Value Type ValueType;113 /// The reference type of the iterator. 114 typedef typename Map::Reference Type ReferenceType;115 /// The pointer type of the iterator. 116 typedef typename Map::Pointer Type PointerType;117 118 /// The const value type of the iterator. 119 typedef typename Map::ConstValue Type ConstValueType;120 /// The const reference type of the iterator. 121 typedef typename Map::ConstReference Type ConstReferenceType;122 /// The pointer type of the iterator. 123 typedef typename Map::ConstPointer Type 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; 124 124 125 125 public: 126 126 127 127 /// The value type of the iterator. 128 typedef extended_pair<Key Type, const KeyType&,129 Value Type, const ValueType&> PairValueType;128 typedef extended_pair<Key, const Key&, 129 Value, const Value&> PairValue; 130 130 131 131 /// The reference type of the iterator. 132 typedef extended_pair<const Key Type&, const KeyType&,133 Reference Type, ReferenceType> PairReferenceType;132 typedef extended_pair<const Key&, const Key&, 133 Reference, Reference> PairReference; 134 134 135 135 /// Default constructor. … … 141 141 142 142 /// Dereference operator for the iterator. 143 PairReference Typeoperator*() {144 return PairReference Type(Base::it, (*map)[Base::it]);145 } 146 147 /// The pointer type of the iterator. 148 class PairPointer Type{143 PairReference operator*() { 144 return PairReference(Base::it, (*map)[Base::it]); 145 } 146 147 /// The pointer type of the iterator. 148 class PairPointer { 149 149 friend class MapIterator; 150 150 private: 151 PairReference Typedata;152 PairPointer Type(const KeyType& key, ReferenceType val)151 PairReference data; 152 PairPointer(const Key& key, Reference val) 153 153 : data(key, val) {} 154 154 public: 155 PairReference Type* operator->() {return &data;}155 PairReference* operator->() {return &data;} 156 156 }; 157 157 158 158 /// Arrow operator for the iterator. 159 PairPointer Typeoperator->() {160 return PairPointer Type(Base::it, ((*map)[Base::it]));159 PairPointer operator->() { 160 return PairPointer(Base::it, ((*map)[Base::it])); 161 161 } 162 162 … … 181 181 typedef std::forward_iterator_tag iterator_category; 182 182 typedef int difference_type; 183 typedef PairValue Typevalue_type;184 typedef PairReference Typereference;185 typedef PairPointer Typepointer;183 typedef PairValue value_type; 184 typedef PairReference reference; 185 typedef PairPointer pointer; 186 186 }; 187 187 … … 198 198 199 199 /// The key type of the iterator. 200 typedef typename Map::Key Type 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::Value Type ValueType;206 /// The reference type of the iterator. 207 typedef typename Map::Reference Type ReferenceType;208 /// The pointer type of the iterator. 209 typedef typename Map::Pointer Type PointerType;210 211 /// The const value type of the iterator. 212 typedef typename Map::ConstValue Type ConstValueType;213 /// The const reference type of the iterator. 214 typedef typename Map::ConstReference Type ConstReferenceType;215 /// The pointer type of the iterator. 216 typedef typename Map::ConstPointer Type 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; 217 217 218 218 public: … … 233 233 234 234 /// The value type of the iterator. 235 typedef extended_pair<Key Type, const KeyType&,236 Value Type, const ValueType&> PairValueType;235 typedef extended_pair<Key, const Key&, 236 Value, const Value&> PairValue; 237 237 238 238 /// The reference type of map. 239 typedef extended_pair<const Key Type&, const KeyType&,240 ConstReference Type, ConstReferenceType> PairReferenceType;239 typedef extended_pair<const Key&, const Key&, 240 ConstReference, ConstReference> PairReference; 241 241 242 242 /// Dereference operator for the iterator. 243 PairReference Typeoperator*() {244 return PairReference Type(Base::it, (*map)[Base::it]);245 } 246 247 /// The pointer type of the iterator. 248 class PairPointer Type{243 PairReference operator*() { 244 return PairReference(Base::it, (*map)[Base::it]); 245 } 246 247 /// The pointer type of the iterator. 248 class PairPointer { 249 249 friend class MapConstIterator; 250 250 private: 251 PairReference Typedata;252 PairPointer Type(const KeyType& key, ConstReferenceType val)251 PairReference data; 252 PairPointer(const Key& key, ConstReference val) 253 253 : data(key, val) {} 254 254 public: 255 PairReference Type* operator->() {return &data;}255 PairReference* operator->() {return &data;} 256 256 }; 257 257 258 258 /// Arrow operator for the iterator. 259 PairPointer Typeoperator->() {260 return PairPointer Type(Base::it, (*map)[Base::it]);259 PairPointer operator->() { 260 return PairPointer(Base::it, (*map)[Base::it]); 261 261 } 262 262 … … 281 281 typedef std::input_iterator_tag iterator_category; 282 282 typedef int difference_type; 283 typedef PairValue Typevalue_type;284 typedef PairReference Typereference;285 typedef PairPointer Typepointer;283 typedef PairValue value_type; 284 typedef PairReference reference; 285 typedef PairPointer pointer; 286 286 }; 287 287 … … 298 298 299 299 /// The key type of the iterator. 300 typedef typename Map::Key Type KeyType;300 typedef typename Map::Key Key; 301 301 /// The iterator to iterate on the keys. 302 302 typedef typename Map::KeyIt KeyIt; … … 324 324 325 325 /// The dereferencing operator of the iterator. 326 Key Typeoperator*() const {327 return static_cast<Key Type>(Base::it);326 Key operator*() const { 327 return static_cast<Key>(Base::it); 328 328 } 329 329 … … 332 332 typedef std::input_iterator_tag iterator_category; 333 333 typedef int difference_type; 334 typedef Key Typevalue_type;335 typedef const Key Type& reference;336 typedef const Key Type* pointer;334 typedef Key value_type; 335 typedef const Key& reference; 336 typedef const Key* pointer; 337 337 }; 338 338 … … 353 353 354 354 /// The key type of the iterator. 355 typedef typename Map::Key Type 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::Value Type ValueType;362 /// The reference type of the iterator. 363 typedef typename Map::Reference Type ReferenceType;364 /// The pointer type of the iterator. 365 typedef typename Map::Pointer Type PointerType;366 367 /// The const value type of the iterator. 368 typedef typename Map::ConstValue Type ConstValueType;369 /// The const reference type of the iterator. 370 typedef typename Map::ConstReference Type ConstReferenceType;371 /// The pointer type of the iterator. 372 typedef typename Map::ConstPointer Type 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; 373 373 374 374 private: … … 400 400 401 401 /// The dereferencing operator of the iterator. 402 Reference Typeoperator*() const {402 Reference operator*() const { 403 403 return (*map)[Base::it]; 404 404 } 405 405 406 406 /// The arrow operator of the iterator. 407 Pointer Typeoperator->() const {407 Pointer operator->() const { 408 408 return &(operator*()); 409 409 } … … 413 413 typedef std::forward_iterator_tag iterator_category; 414 414 typedef int difference_type; 415 typedef Value Typevalue_type;416 typedef Reference Typereference;417 typedef Pointer Typepointer;415 typedef Value value_type; 416 typedef Reference reference; 417 typedef Pointer pointer; 418 418 }; 419 419 … … 431 431 432 432 /// The key type of the iterator. 433 typedef typename Map::Key Type 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::Value Type ValueType;439 /// The reference type of the iterator. 440 typedef typename Map::Reference Type ReferenceType;441 /// The pointer type of the iterator. 442 typedef typename Map::Pointer Type PointerType;443 444 /// The const value type of the iterator. 445 typedef typename Map::ConstValue Type ConstValueType;446 /// The const reference type of the iterator. 447 typedef typename Map::ConstReference Type ConstReferenceType;448 /// The pointer type of the iterator. 449 typedef typename Map::ConstPointer Type 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; 450 450 451 451 private: … … 482 482 483 483 /// The dereferencing operator of the iterator. 484 ConstReference Typeoperator*() const {484 ConstReference operator*() const { 485 485 return (*map)[Base::it]; 486 486 } 487 487 488 488 /// The arrow operator of the iterator. 489 ConstPointer Typeoperator->() const {489 ConstPointer operator->() const { 490 490 return &(operator*()); 491 491 } … … 495 495 typedef std::input_iterator_tag iterator_category; 496 496 typedef int difference_type; 497 typedef Value Typevalue_type;498 typedef ConstReference Typereference;499 typedef ConstPointer Typepointer;497 typedef Value value_type; 498 typedef ConstReference reference; 499 typedef ConstPointer pointer; 500 500 }; 501 501 … … 512 512 513 513 /// The key type of the iterator. 514 typedef typename Map::Key Type 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::Value Type ValueType;521 /// The reference type of the iterator. 522 typedef typename Map::Reference Type ReferenceType;523 /// The pointer type of the iterator. 524 typedef typename Map::Pointer Type PointerType;525 526 /// The const value type of the iterator. 527 typedef typename Map::ConstValue Type ConstValueType;528 /// The const reference type of the iterator. 529 typedef typename Map::ConstReference Type ConstReferenceType;530 /// The pointer type of the iterator. 531 typedef typename Map::ConstPointer Type 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; 532 532 533 533 /// The map initialized const key set. … … 549 549 public: 550 550 // STL compatibility typedefs. 551 typedef Value Typevalue_type;551 typedef Value value_type; 552 552 typedef ConstIterator const_iterator; 553 typedef ConstReference Typeconst_reference;554 typedef ConstPointer Typeconst_pointer;553 typedef ConstReference const_reference; 554 typedef ConstPointer const_pointer; 555 555 typedef int difference_type; 556 556 }; … … 568 568 569 569 /// The key type of the iterator. 570 typedef typename Map::Key Type 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::Value Type ValueType;577 /// The reference type of the iterator. 578 typedef typename Map::Reference Type ReferenceType;579 /// The pointer type of the iterator. 580 typedef typename Map::Pointer Type PointerType;581 582 /// The const value type of the iterator. 583 typedef typename Map::ConstValue Type ConstValueType;584 /// The const reference type of the iterator. 585 typedef typename Map::ConstReference Type ConstReferenceType;586 /// The pointer type of the iterator. 587 typedef typename Map::ConstPointer Type 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; 588 588 589 589 /// The map initialized const value set. … … 605 605 public: 606 606 // STL compatibility typedefs. 607 typedef Value Typevalue_type;607 typedef Value value_type; 608 608 typedef ConstIterator const_iterator; 609 typedef ConstReference Typeconst_reference;610 typedef ConstPointer Typeconst_pointer;609 typedef ConstReference const_reference; 610 typedef ConstPointer const_pointer; 611 611 typedef int difference_type; 612 612 }; … … 625 625 626 626 /// The key type of the iterator. 627 typedef typename Map::Key Type 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::Value Type ValueType;634 /// The reference type of the iterator. 635 typedef typename Map::Reference Type ReferenceType;636 /// The pointer type of the iterator. 637 typedef typename Map::Pointer Type PointerType;638 639 /// The const value type of the iterator. 640 typedef typename Map::ConstValue Type ConstValueType;641 /// The const reference type of the iterator. 642 typedef typename Map::ConstReference Type ConstReferenceType;643 /// The pointer type of the iterator. 644 typedef typename Map::ConstPointer Type 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; 645 645 646 646 /// The map initialized value set. … … 675 675 public: 676 676 // STL compatibility typedefs. 677 typedef Value Typevalue_type;677 typedef Value value_type; 678 678 typedef Iterator iterator; 679 679 typedef ConstIterator const_iterator; 680 typedef Reference Typereference;681 typedef ConstReference Typeconst_reference;682 typedef Pointer Typepointer;683 typedef ConstPointer Typeconst_pointer;680 typedef Reference reference; 681 typedef ConstReference const_reference; 682 typedef Pointer pointer; 683 typedef ConstPointer const_pointer; 684 684 typedef int difference_type; 685 685
Note: See TracChangeset
for help on using the changeset viewer.