21 #ifndef IMPLICIT_ENTRY_MAP_ITERATOR_IMPL_H 22 #define IMPLICIT_ENTRY_MAP_ITERATOR_IMPL_H 24 #ifndef IMPLICIT_ENTRY_MAP_ITERATOR_H 25 #include "SheafSystem/implicit_entry_map_iterator.h" 28 #ifndef ASSERT_CONTRACT_H 29 #include "SheafSystem/assert_contract.h" 32 #ifndef IMPLICIT_ENTRY_MAP_H 33 #include "SheafSystem/implicit_entry_map.h" 37 #include "SheafSystem/rc_ptr.h" 49 template <
typename E,
typename I>
67 template <
typename E,
typename I>
84 template <
typename E,
typename I>
100 _item = &_map->value(_id);
112 template <
typename E,
typename I>
128 _item = &_map->value(_id);
131 const E& result = *_item;
140 template <
typename E,
typename I>
160 template <
typename E,
typename I>
171 if(_explicit_value_itr != _map->_explicit_value_map.end())
175 _id = _explicit_value_itr->first;
176 _item = &**_explicit_value_itr->second;
178 _explicit_value_itr++;
180 else if(_interval_itr != _map->_interval_map.end())
199 if(!_map->contains_implicit_entry(_id))
210 assertion(_interval_itr->second == 0);
212 _id = _interval_itr->first;
219 assertion(_interval_itr != _map->_interval_map.end());
220 assertion(_interval_itr->second != 0);
222 _end = _interval_itr->first;
231 if(_interval_itr != _map->_interval_map.end())
233 if(_interval_itr->second == 0)
238 _id = _interval_itr->first;
245 assertion(_interval_itr != _map->_interval_map.end());
246 assertion(_interval_itr->second != 0);
251 _end = _interval_itr->first;
261 while(
is_valid(_id) && _map->contains_explicit_entry(_id));
282 template <
typename E,
typename I>
300 template <
typename E,
typename I>
312 _explicit_value_itr = _map->_explicit_value_map.begin();
313 _interval_itr = _map->_interval_map.begin();
328 template <
typename E,
typename I>
354 template <
typename E,
typename I>
374 template <
typename E,
typename I>
388 ensure(is_same_type(result));
395 template <
typename E,
typename I>
406 _item = xother._item;
407 _explicit_value_itr = xother._explicit_value_itr;
408 _interval_itr = xother._interval_itr;
420 template <
typename E,
typename I>
427 if(invariant_check())
435 disable_invariant_check();
443 enable_invariant_check();
462 #endif // ifndef IMPLICIT_ENTRY_MAP_IMPL_H virtual bool invariant() const
Class invariant, intended to be redefined in each descendant. See below for template for invariant in...
void next()
Makes item() the next integer in the iteration.
void reset()
Restarts the iteration.
Abstract base class with useful features for all objects.
A map in which the entries may be implicit.
implicit_entry_map_iterator()
Default constructor; disabled.
~implicit_entry_map_iterator()
Destructor.
An iterator over the entries in an implicit_entry_map. This iteration is NOT order preserving...
E & item()
The current value of the iteration (mutable version).
virtual implicit_entry_map_iterator * clone() const
Virtual constructor, makes a new instance of the same type as this.
pod_type id() const
The current id of the value of the iteration.
implicit_entry_map_iterator & operator=(const implicit_entry_map_iterator &xother)
Assignment operator.
bool is_done() const
True if iteration is finished.
Namespace for the sheaves component of the sheaf system.
virtual bool invariant() const
Class invariant.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
implicit_entry_map< E, I >::pod_type pod_type
The "plain old data" index type for this.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.