21 #include "SheafSystem/hub_index_space_handle.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/index_space_family.h" 24 #include "SheafSystem/primary_sum_index_space_state.h" 61 ensure((*
this) == xother);
74 require(xid_spaces.
contains(xindex));
86 ensure(
index() == xindex);
95 const std::string& xname)
111 ensure(
name() == xname);
133 ensure((*
this) == xother);
171 ensure(&
state() == &xstate);
193 ensure(is_basic_query);
215 ensure(is_basic_query);
302 ensure(is_basic_query);
321 ensure(is_basic_query);
350 ensure(
ct() == old_ct + xct);
351 ensure(
next_id() == old_next_id + xct);
379 ensure(
ct() == old_ct + xct);
408 ensure(
ct() <= old_ct);
436 ensure(
ct() == (old_ct - old_last_term_ct + xct));
451 require(xbegin < xend);
459 ensure(is_basic_query);
472 require(xbegin < xend);
480 ensure(is_basic_query);
493 require(xbegin < xend);
501 ensure(is_basic_query);
601 ensure(is_basic_query);
678 ensure(is_basic_query);
697 ensure(is_basic_query);
716 ensure(is_basic_query);
765 ensure(is_basic_query);
839 ensure((*
this) == xother);
861 ensure(*result == *
this);
895 ensure(is_basic_query);
virtual pod_type glued_hub_pod(pod_type xid) const
The pod index in the hub id space equivalent to xid in this id space. synonym for unglued_hub_pod(xid...
bool interval_is_empty(pod_type xbegin, pod_type xend) const
True if all ids in the interval [xbegin, xend) are not in this space.
hub_index_space_handle()
Default constructor.
pod_type next_id() const
The next available id.
pod_type term_id_begin() const
Beginning index of the terms in this sum.
virtual void attach_to(pod_type xindex)
Attach to the state with index xindex in the id space family id_spaces().
virtual pod_type index() const
Index of this space.
void clear_ids()
Deallocate all non-standard ids.
pod_type term_id_end() const
Ending index of the terms in this sum.
void unglue_all(pod_type xrep_id)
Unglue all ids glued to representative xrep_id; makes each id in the equivalence class of xrep_id its...
bool has_only_standard_ids() const
True if and only if there are only standard ids.
void extend_last_term(size_type xct)
Extends the last term to ct() == xct.
pod_type next_id() const
The next available id.
void glue(pod_type xid, pod_type xrep)
Glues xid to xrep; adds xid to the equivalence class with representative member xrep.
hub_index_space_handle & operator=(const hub_index_space_handle &xother)
Assignment operator; attach this handle to the state of xother. synonym for attach_to(xother).
bool is_valid_reserved_id(pod_type xid) const
True if and only if the reserved term containing xid is already a reserved term or is available for a...
bool interval_is_empty(pod_type xbegin, pod_type xend) const
True if all ids in the interval [xbegin, xend) are not in this space.
primary_sum_index_space_state & state()
The primary sum id space state (mutable version).
bool contains_unique_rep(pod_type xhub_id) const
True if and only if hub id xhub_id is the only member of its equivalence class.
void update_gathered_id_space()
Update the gathered id space.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
virtual const index_space_family & id_spaces() const
The id space family for this (const version).
bool interval_is_full(pod_type xbegin, pod_type xend) const
True if all ids in the interval [xbegin, xend) are in this space.
const index_space_handle & new_gathered_id_space(bool xexclude_bottom)
Construct a gathered id space from this id space. If xexclude_bottom, construct the id space without ...
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...
void unglue_all(pod_type xrep_id)
Unglue all ids glued to representative xrep_id; makes each id in the equivalence class of xrep_id its...
virtual bool invariant() const
Class invariant.
virtual bool invariant() const
Class invariant.
Abstract base class with useful features for all objects.
bool interval_is_available(pod_type xbegin, pod_type xend) const
True if the ids in the interval [xbegin, xend) are available in this space.
pod_type new_primary_term(size_type xct)
Create a new primary term [next_id(), next_id()+xct). Returns the index of the term created...
pod_type term_end(pod_type xi) const
Ending id of the xi-th term.
const index_space_handle & new_gathered_id_space(bool xexclude_bottom)
Construct a gathered id space from this id space. If xexclude_bottom, construct the id space without ...
void glue(pod_type xid, pod_type xrep)
Glues xid to xrep; adds xid to the equivalence class with representative member xrep.
void extend_last_term(size_type xct)
Extends the last term to ct() == xct.
void delete_id(pod_type xid)
Deallocate the id xid in this space.
void unglue(pod_type xid)
Unglues xid; makes xid its own representative.
pod_type new_primary_term(size_type xct)
Create a new primary term [next_id(), next_id()+xct). Returns the index of the term created...
void unglue(pod_type xid)
Unglues xid; makes xid its own representative.
std::string name() const
Name of this space.
pod_index_type pod_type
The "plain old data" index type for this.
bool gathered_id_space_excludes_bottom() const
True, if the gathered id space excludes BOTTOM_INDEX.
virtual bool is_attached() const
True if this handle is attached to a state.
pod_type term_begin(pod_type xi) const
Beginning id of the xi-th term.
bool is_gathered() const
True if begin() == 0 and end() == ct().
const index_space_handle & gathered_id_space() const
The gathered id space.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
void update_gathered_id_space()
Update the gathered id space.
pod_type term_id(pod_type xid) const
The id of the term containing id xid.
void update_standard_ids()
Make end() the standard id end.
bool has_only_standard_ids() const
True if and only if there are only standard ids.
void clear_ids()
Deallocate all non-standard ids.
A collection of id space states. This is a virtual class with provides an interface for accessing the...
pod_type new_id()
Allocate the next available id in this space.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
bool contains_term_id(pod_type xi) const
True if this map contains the xi-th term.
bool interval_is_full(pod_type xbegin, pod_type xend) const
True if all ids in the interval [xbegin, xend) are in this space.
virtual bool contains(pod_type xlocal_id) const =0
True if this collection contains the id space with local id xlocal_id.
An implemenation of class explicit_index_space_handle that has a sum id space state.
bool is_valid_reserved_id(pod_type xid) const
True if and only if the reserved term containing xid is already a reserved term or is available for a...
void delete_id(pod_type xid)
Deallocate the id xid in this space.
pod_type new_id()
Allocate the next available id in this space.
const index_space_handle & last_term() const
The last term.
bool gathered_id_space_excludes_bottom() const
True, if the gathered id space excludes BOTTOM_INDEX.
bool has_gathered_id_space() const
True, if the gathered id space exists.
bool invariant_check() const
True if invariant checking is enabled.
const index_space_handle & term(pod_type xi) const
The xi-th term.
bool has_gathered_id_space() const
True, if the gathered id space exists.
int_type pod_index_type
The plain old data index type.
virtual ~hub_index_space_handle()
Destructor.
void remove_term(pod_type xi)
Remove xi-th term of this sum.
bool contains(pod_type xid) const
True, if this contains an id space with id xid.
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...
void update_standard_ids()
Make end() the standard id end.
virtual size_type ct() const
The number of members.
An implementation of class sum_index_space_state intended for use as the sum of the primary id spaces...
bool interval_is_available(pod_type xbegin, pod_type xend) const
True if the ids in the internal [xbegin, xend) are available in this space.
virtual hub_index_space_handle * clone() const
Virtual constructor, makes a new instance of the same type as this. If the handle is attached...
Factory and container for a family of id spaces.
bool contains_rep(pod_type xhub_id) const
True if and only if hub id xhub_id is the representative member of its equivalence class...
void remove_term(pod_type xi)
Remove xi-th term of this sum.
const index_space_handle & gathered_id_space() const
The gathered id space.
bool has_gluing() const
Ture if there is any gluing.
bool is_same_type(const any *other) const
True if other is the same type as this.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
void enable_invariant_check() const
Enable invariant checking.
bool has_gluing() const
Ture if there is any gluing.
virtual bool contains(pod_type xid) const
True if this space contains id xid.