21 #include "SheafSystem/sum_index_space_handle.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/index_space_family.h" 24 #include "SheafSystem/scoped_index.h" 25 #include "SheafSystem/sum_index_space_state.h" 62 ensure((*
this) == xother);
75 require(xid_spaces.
contains(xindex));
87 ensure(
index() == xindex);
96 const std::string& xname)
100 require(xid_spaces.
contains(xname));
112 ensure(
name() == xname);
134 ensure((*
this) == xother);
174 ensure(is_basic_query);
196 ensure(is_basic_query);
226 ensure(!result.empty());
307 ensure(is_basic_query);
347 ensure(is_basic_query);
366 ensure(is_basic_query);
385 ensure(is_basic_query);
406 ensure(is_basic_query);
427 ensure(is_basic_query);
449 ensure(is_basic_query);
470 ensure(is_basic_query);
491 ensure(is_basic_query);
512 ensure(is_basic_query);
533 ensure(is_basic_query);
554 ensure(is_basic_query);
681 ensure((*
this) == xother);
704 ensure(*result == *
this);
738 ensure(is_basic_query);
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 term_begin(pod_type xi) const
Beginning id of the xi-th term.
pod_type term_id_begin() const
Beginning index of the terms in this sum.
virtual sum_index_space_handle * clone() const
Virtual constructor, makes a new instance of the same type as this. If the handle is attached...
virtual void attach_to(pod_type xindex)
Attach to the state with index xindex in the id space family id_spaces().
sum_index_space_handle & operator=(const sum_index_space_handle &xother)
Assignment operator; attach this handle to the state of xother. synonym for attach_to(xother).
virtual pod_type index() const
Index of this space.
pod_type term_id_end() const
Ending index of the terms in this sum.
bool in_scope() const
True if and only if scope() contains an entry for pod().
bool is_empty() const
True if there are no ids in the space.
void simple(pod_type xterm_id, pod_type xlocal_id, pod_type &xindex) const
Converts binary components xterm_id, xlocal_id to simple index xindex.
pod_type term_id(pod_type xid) const
The id of the term containing id xid.
size_type equivalence_ct(pod_type xhub_id) const
The number of members of the equivalence class of hub id xhub_id.
void equivalence_class(pod_type xhub_id, equivalence_class_type &result) const
The equivalence class associated with the hub id xhub_id.
virtual bool contains_term_id(pod_type xi) const =0
True if this map contains the xi-th term.
bool contains_hub(pod_type xid) const
True if this space contains an id equivalent to xid in the unglued hub id space. synonym for contains...
pod_type term_hub_end(pod_type xi) const
Ending hub id of the xi-th term.
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.
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).
virtual pod_type host_rep(pod_type xhub_id) const =0
The host id associated with the representative member of the equivalence class of hub id xhub_id...
virtual bool is_attached() const =0
True if this handle is attached to a state.
std::list< pod_type > equivalence_class_type
The type used to represent an equivalence class.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
const index_space_handle & term(pod_type xi) const
The xi-th term.
virtual pod_type term_id_end() const =0
Ending index of the terms in this sum.
pod_type host_rep(pod_type xhub_id) const
The host id associated with the representative member of the equivalence class of hub id xhub_id...
virtual bool invariant() const
Class invariant.
Abstract base class with useful features for all objects.
void binary(pod_type xindex, pod_type &xterm_id, pod_type &xlocal) const
Converts simple index xindex to its binary components xterm_id and xlocal_id.
void binary(pod_type xindex, pod_type &xterm_id, pod_type &xlocal) const
Converts simple index xindex to its binary components xterm_id and xlocal_id.
pod_type term_end(pod_type xi) const
Ending id of the xi-th term.
An implementation of class index_space_handle for an explicit_index_space_state.
std::string name() const
Name of this space.
pod_index_type pod_type
The "plain old data" index type for this.
sum_index_space_handle()
Default constructor.
An index within the external ("client") scope of a given id space.
virtual bool is_attached() const
True if this handle is attached to a state.
An abstract id space of alternate integer identifiers which is the sum (disjoint union) of two or mor...
const index_space_handle & term_of(pod_type xid) const
The term containing id xid.
pod_type term_begin(pod_type xi) const
Beginning id of the xi-th term.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
pod_type term_hub_end(pod_type xi) const
Ending hub id of the xi-th term.
const index_space_handle & last_term() const
The last term.
virtual bool invariant() const
Class invariant.
void simple(pod_type xterm_id, pod_type xlocal_id, pod_type &xindex) const
Converts binary components xterm_id, xlocal_id to simple index xindex.
pod_type term_id(pod_type xid) const
The id of the term containing id xid.
pod_type term_end(pod_type xi) const
Ending id of the xi-th term.
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...
sum_index_space_state & state()
The sum id space state (mutable version).
bool contains_term_id(pod_type xi) const
True if this map contains the xi-th term.
virtual bool contains_rep(pod_type xhub_id) const =0
True if and only if hub id xhub_id is the representative member of its equivalence class...
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.
void clear()
Deletes all entries.
pod_type rep(pod_type xhub_id) const
The representative member of the equivalence class of hub id xhub_id.
void equivalence_class(pod_type xhub_id, equivalence_class_type &result) const
The equivalence class associated with the hub id xhub_id.
pod_type term_hub_begin(pod_type xi) const
Beginning hub id of the xi-th term.
const index_space_handle & last_term() const
The last term.
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.
bool invariant_check() const
True if invariant checking is enabled.
const index_space_handle & term(pod_type xi) const
The xi-th term.
virtual pod_type rep(pod_type xhub_id) const =0
The representative member of the equivalence class of hub id xhub_id.
virtual pod_type term_id_begin() const =0
Beginning index of the terms in this sum.
bool contains(pod_type xid) const
True, if this contains an id space with id xid.
virtual ~sum_index_space_handle()
Destructor.
virtual void clear()
Deletes all entries.
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...
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
bool is_same_type(const any *other) const
True if other is the same type as this.
pod_type term_hub_begin(pod_type xi) const
Beginning hub id of the xi-th term.
void enable_invariant_check() const
Enable invariant checking.
const index_space_handle & term_of(pod_type xid) const
The term containing id xid.
virtual bool contains(pod_type xid) const
True if this space contains id xid.
size_type equivalence_ct(pod_type xhub_id) const
The number of members of the equivalence class of hub id xhub_id.