| 25 | |
| 26 | public: |
| 27 | class const_iterator |
| 28 | { |
| 29 | typedef std::map<LogicalLocation, |
| 30 | std::shared_ptr<const Sector>>::const_iterator wrapped_iterator_t; |
| 31 | |
| 32 | public: |
| 33 | const_iterator(const wrapped_iterator_t& it): _it(it) {} |
| 34 | std::shared_ptr<const Sector> operator*() |
| 35 | { |
| 36 | return _it->second; |
| 37 | } |
| 38 | |
| 39 | void operator++() |
| 40 | { |
| 41 | _it++; |
| 42 | } |
| 43 | |
| 44 | bool operator==(const const_iterator& other) const |
| 45 | { |
| 46 | return _it == other._it; |
| 47 | } |
| 48 | |
| 49 | bool operator!=(const const_iterator& other) const |
| 50 | { |
| 51 | return _it != other._it; |
| 52 | } |
| 53 | |
| 54 | private: |
| 55 | wrapped_iterator_t _it; |
| 56 | }; |
| 57 | |
| 58 | public: |
| 59 | void calculateSize(); |