21 #include "SheafSystem/ragged_array_implicit_index_space_iterator.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/ragged_array_index_space_interval.h" 25 #include "SheafSystem/index_space_family.h" 62 ensure((*
this) == xother);
86 ensure(
index() == xindex);
95 const std::string& xname)
110 ensure(
name() == xname);
130 (void) implicit_index_space_iterator::operator=(xother);
140 ensure((*
this) == xother);
198 (void) this->
operator=(lother);
203 ensure((*
this) == xother);
227 result = result && (
_end == lother.
_end);
255 ensure(*result == *
this);
372 require(reinterpret_cast<const ragged_array_index_space_interval&>(xhost).ct(xlocal_id) > 0);
397 ensure(&
host() == &xhost);
418 ensure(is_basic_query);
pod_type _end
The end of this id space.
virtual void attach_to(const index_space_collection &xhost, pod_type xlocal_id)
Attach to the state with local scope id, xlocal_id in the host id space collection xhost...
An abstract iterator over the ids of an id space.
bool _is_done
True if the iteration is finished.
virtual bool conforms_to_state(const index_space_collection &xhost, pod_type xlocal_id) const
True if this conforms to the handle type required by the state with local scope id xlocal_id in the h...
pod_type pod() const
The current id in the iteration.
virtual pod_type family_scope(pod_type xlocal_id) const =0
Id relative to the id space family equivalent to the local id xlocal_id.
void invalidate_ids()
Set is_done() and invalidate pod() and hub_pod().
virtual const index_space_collection & host() const
The host collection.
virtual pod_type index() const
Index of this space.
virtual void reset()
Restarts the iteration.
virtual void detach()
Detach this iterator form its state, if any.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
Abstract base class with useful features for all objects.
std::string name() const
Name of this space.
const ragged_array< pod_type > & hub_ids() const
The ragged array of hub ids.
virtual pod_type end(pod_type xlocal_id) const
Ending id of the space with id xlocal_id.
bool is_done() const
True if iteration is finished.
virtual bool invariant() const
Class invariant.
const index_space_family & id_spaces() const
The id space family for this (const version).
An implementation of index_space_interval for an interval of implicit id spaces in which the hub ids ...
ragged_array_implicit_index_space_iterator()
Default constructor.
pod_type _hub_pod
The current hub id in the iteration.
A collection of id space states. This is a virtual class with provides an interface for accessing the...
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
virtual bool contains(pod_type xlocal_id) const =0
True if this collection contains the id space with local id xlocal_id.
virtual void next()
Makes item() the next id in the iteration.
virtual bool invariant() const
Class invariant.
virtual bool is_attached() const
True if this iterator is attached to a state.
bool invariant_check() const
True if invariant checking is enabled.
const index_space_collection * _host
The host collection.
pod_type _local_id
The id of this space in the local host id space.
pod_type _pod
The current id in the iteration.
Factory and container for a family of id spaces.
pod_index_type pod_type
The "plain old data" index type for this.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
An implementation of implicit_index_space_iterator for an implicit id space in an ragged_array_index_...
bool is_same_type(const any *other) const
True if other is the same type as this.
virtual bool operator==(const index_space_iterator &xother) const
True if this is equivalent to xother.
void enable_invariant_check() const
Enable invariant checking.
virtual ragged_array_implicit_index_space_iterator * clone() const
Virtual constructor, makes a new instance of the same type as this. If the iterator is attached...
ragged_array_implicit_index_space_iterator & operator=(const ragged_array_implicit_index_space_iterator &xother)
True if this is equivalent to xother.
virtual ~ragged_array_implicit_index_space_iterator()
Destructor.
virtual bool operator==(const index_space_iterator &xother) const
True if this is equivalent to xother.
pod_type hub_pod() const
The current unglued hub id in the iteration. synonym for unglued_hub_pod().
const pod_type * _to_hub
The ragged_array to hub ids.