21 #include "SheafSystem/index_space_interval_iterator.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/hub_index_space_handle.h" 24 #include "SheafSystem/index_space_interval.h" 25 #include "SheafSystem/index_space_family.h" 26 #include "SheafSystem/index_space_iterator.h" 68 ensure((*
this) == xother);
87 result = result && (
_ub == xother.
_ub);
92 ensure(is_basic_query);
114 ensure(*result == *
this);
135 ensure(is_basic_query);
154 ensure(is_basic_query);
175 ensure(is_basic_query);
233 ensure(is_basic_query);
309 ensure((*
this) == xother);
354 ensure(&
host() == &xhost);
355 ensure(
ub() == (xhost.
end() - xhost.
begin()));
390 bool result = (
_host != 0);
394 ensure(is_basic_query);
424 ensure(is_basic_query);
445 ensure(is_basic_query);
466 ensure(is_basic_query);
488 ensure(is_basic_query);
510 ensure(is_basic_query);
532 ensure(is_basic_query);
554 ensure(is_basic_query);
576 ensure(is_basic_query);
598 ensure(is_basic_query);
620 ensure(is_basic_query);
642 ensure(is_basic_query);
752 ensure(is_basic_query);
808 ensure(is_basic_query);
830 ensure(is_basic_query);
886 ensure(is_basic_query);
908 ensure(is_basic_query);
virtual bool invariant() const
Class invariant, intended to be redefined in each descendant. See below for template for invariant in...
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
void release_id_space(index_space_handle &xid_space) const
Returns the id space handle xid_space to the handle pool.
size_type _ub
The upper bound of the iteration.
virtual bool allocated_id_space_iterator(const index_space_iterator &xitr) const =0
True if and only if id space iterator xitr was allocated by the iterator pool.
void detach()
Detach this iterator.
virtual const index_space_family & id_spaces() const
The id space family for this (const version).
pod_type hub_pod(pod_type xid) const
The pod index in the unglued hub id space equivalent to xid in this id space.
An abstract iterator over the ids of an id space.
bool operator==(const index_space_interval_iterator &xother) const
True if this is equivalent to xother.
bool is_attached() const
True, if this iterator is attached.
const index_space_family & id_spaces() const
The id space family for this (const version).
void next()
Makes id_space() the next id space in the iteration.
pod_type pod(pod_type xid) const
The pod index in this space equivalent to xid in the hub id space.
bool contains_glued_hub(pod_type xlocal_id, pod_type xid) const
True if the space with id xlocal_id contains an id equivalent to xid in the glued hub id space...
bool contains_hub(pod_type xid) const
True if this space contains an id equivalent to xid in the unglued hub id space.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
pod_type end() const
Ending id of this space.
bool allocated_id_space(index_space_handle &xid_space) const
True if and only if id space handle xid_space was allocated by the handle pool.
virtual pod_type family_scope(pod_type xlocal_id) const
Id relative to the id space family equivalent to the local id xlocal_id.
index_space_iterator & get_id_space_iterator() const
Allocates an id space iterator from the iterator pool attached to the current id space state...
virtual bool allocated_id_space(const index_space_handle &xid_space) const =0
True if and only if id space handle xid_space was allocated by the handle pool.
virtual bool is_attached() const =0
True if this handle is attached to a state.
An implementation of class sum_index_space_handle that has a primary sum id space state...
virtual bool contains_unglued_hub(pod_type xlocal_id, pod_type xid) const =0
True if the space with id xlocal_id contains an id equivalent to xid in the unglued hub id space...
bool _only_persistent
True if only the persistent id spaces are iterated over.
bool is_done() const
True if iteration is finished.
Abstract base class with useful features for all objects.
index_space_interval_iterator * clone() const
Virtual constructor, makes a new instance of the same type as this. If the iterator is attached...
An implemenation of index_space_collection that adds an interface for the interval [begin()...
bool contains_unglued_hub(pod_type xid) const
True if this space contains an id equivalent to xid in the unglued hub id space.
void release_id_space_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the iterator pool.
pod_type unglued_hub_pod(pod_type xid) const
The pod index in the unglued hub id space equivalent to xid in this id space.
void reset()
Restarts the iteration.
bool contains_glued_hub(pod_type xid) const
True if this space contains an id equivalent to xid in the glued hub id space.
pod_type glued_hub_pod(pod_type xid) const
The pod index in the glued hub id space equivalent to xid in this id space.
pod_index_type pod_type
The "plain old data" index type for this.
pod_index_type pod_type
The "plain old data" index type for this.
virtual ~index_space_interval_iterator()
Destructor.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
size_type ct() const
The number of members.
virtual size_type ct(pod_type xlocal_id) const =0
The number of members for the id space with id xlocal_id.
virtual pod_type pod(pod_type xlocal_id, pod_type xid) const =0
The pod index in the space with id xlocal_id equivalent to xid in the hub id space.
pod_type glued_hub_pod(pod_type xlocal_id, pod_type xid) const
The pod index in the unglued hub id space equivalent to xid in the id space with id xlocal_id...
virtual bool is_persistent(pod_type xlocal_id) const =0
True if the id space with id xlocal_id should be written to disk.
virtual pod_type unglued_hub_pod(pod_type xlocal_id, pod_type xid) const =0
The pod index in the glued hub id space equivalent to xid in the id space with id xlocal_id...
bool only_persistent() const
True if only the persistent id spaces are iterated over.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
bool is_persistent() const
True if this id space should be written to disk.
An abstract iterator over the id spaces of a interval.
void attach_to(index_space_interval &xhost)
Attach this iterator to the host xhost.
const index_space_interval & host() const
The host id space interval being iterated over.
pod_type begin() const
Beginning id of this space.
virtual bool is_attached() const =0
True if this iterator is attached to a state.
bool invariant_check() const
True if invariant checking is enabled.
virtual index_space_handle & get_id_space(pod_type xlocal_id) const =0
Allocates an id space handle from the handle pool attached to state with id xlocal_id.
pod_type index() const
The index of the current id space in the iteration.
virtual index_space_iterator & get_id_space_iterator(pod_type xlocal_id) const =0
Allocates an id space iterator from the iterator pool attached to state with id xlocal_id.
pod_type end() const
Ending space id of this interval in the id space family scope.
virtual bool contains(pod_type xlocal_id) const
True if this collection contains the id space with local id xlocal_id.
virtual void release_id_space_iterator(index_space_iterator &xitr) const =0
Returns the id space iterator xitr to the iterator pool.
index_space_interval_iterator()
Default constructor; disabled.
Factory and container for a family of id spaces.
pod_type hub_pod(pod_type xlocal_id, pod_type xid) const
The pod index in the glued hub id space equivalent to xid in the id space with id xlocal_id...
index_space_interval_iterator & operator=(const index_space_interval_iterator &xother)
Assignment operator.
bool contains_hub(pod_type xlocal_id, pod_type xid) const
True if the space with id xlocal_id contains an id equivalent to xid in the hub id space...
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
pod_type begin() const
Beginning space id of this interval in the id space family scope.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
bool is_same_type(const any *other) const
True if other is the same type as this.
void enable_invariant_check() const
Enable invariant checking.
virtual void release_id_space(index_space_handle &xid_space) const =0
Returns the id space handle xid_space to the handle pool.
index_space_interval * _host
The host id space interval being iterated over.
bool allocated_id_space_iterator(index_space_iterator &xitr) const
True if and only if id space iterator xitr was allocated by the iterator pool.
const hub_index_space_handle & hub_id_space() const
The hub id space of this family.
index_space_handle & get_id_space() const
Allocates an id space handle from the handle pool attached to the current id space state...
bool contains(pod_type xid) const
True if this space contains id xid.
virtual bool invariant() const
Class invariant.
const hub_index_space_handle & hub_id_space() const
The hub id space.
pod_type _local_id
The local id of the current id space in the iteration.
size_type ub() const
The upper bound of the id spaces.