21 #include "SheafSystem/index_equivalence_iterator.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/index_space_family.h" 35 bool xonly_persistent,
37 : _equivalence_class(xid_spaces, xonly_persistent, xsort_ids)
56 ensure(
rep_id() == xrep_id);
68 bool xonly_persistent,
100 bool xonly_persistent,
191 ensure(
rep_id() == xrep_id);
250 ensure(is_basic_query);
311 ensure(!
is_done() ?
item().first != old_space_index :
true);
336 _itr = lequivalence_list.begin();
337 _end = lequivalence_list.end();
virtual bool invariant() const
Class invariant, intended to be redefined in each descendant. See below for template for invariant in...
pod_index_type _rep_id
The representative of this equivalence class.
const member_type & item() const
The current equivalence class member.
bool is_valid() const
True if this is a valid id.
void next()
Makes item() the next item in the equivalence class.
index_equivalence_class::member_type member_type
The member type for the equivalence id list. The first value in the pair is the index of the id space...
void put_rep_id(pod_index_type xrep_id)
Sets rep_id() to xrep_id.
bool _is_sorted
True, if the ids are sorted in increasing space id order.
const index_space_family & id_spaces() const
The id space family of this equivalence class.
size_type equivalence_ct(pod_index_type xrep_id) const
The number of ids in the equivalence list for the representive id, xrep_id.
virtual ~index_equivalence_iterator()
Destructor.
index_equivalence_iterator()
Default constructor; disabled.
size_type ct() const
The number of items in the current equivalence list being iterated over.
bool only_persistent() const
True, if only persistent id spaces should be iterated over.
Abstract base class with useful features for all objects.
bool is_done() const
True if iteration is finished.
virtual index_equivalence_iterator * clone() const
Virtual constructor, makes a new instance of the same type as this.
pod_index_type rep_id() const
The representative id in the top id space of this equivalence class.
index_equivalence_iterator & operator=(const index_equivalence_iterator &xother)
Assignment operator.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
An index within the external ("client") scope of a given id space.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
void reset()
Restarts the iteration.
iterator_type _itr
The current equivalence list iterator.
void put(const index_space_handle &xid_space, pod_type xpod)
Set the scope to id space, xid_space and pod() to xpod.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
iterator_type _end
The end of the current list begin iterated over.
std::list< member_type > list_type
The equivalence id list type for this.
virtual bool invariant() const
Class invariant.
const list_type & equivalence_list(pod_index_type xrep_id) const
The equivalence list for the representive id, xrep_id.
bool invariant_check() const
True if invariant checking is enabled.
int_type pod_index_type
The plain old data index type.
bool _only_persistent
True, if only persistent id spaces should be iterated over.
bool _is_done
True if iteration is finished.
An iterator over members of an id equivalence class.
index_equivalence_class _equivalence_class
The equivalence class to iterate over.
Factory and container for a family of id spaces.
const index_space_family * _id_spaces
The id space family to iterate over.
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.
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.
const hub_index_space_handle & hub_id_space() const
The hub id space of this family.
member_type _item
The current equivalence class member.
virtual bool contains(pod_type xid) const
True if this space contains id xid.
bool is_sorted() const
True, if the ids are sorted in increasing space id order.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.