21 #include "SheafSystem/singleton_index_space_handle.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/index_space_family.h" 24 #include "SheafSystem/singleton_index_space_state.h" 35 const std::string& xname,
40 require(!xname.empty());
41 require(!xid_spaces.
contains(xname));
53 ensure(&result.id_spaces() == &xid_spaces);
55 ensure(result.conforms_to_state(xname));
57 ensure(result.name() == xname);
58 ensure(!result.is_persistent());
60 ensure(result.hub_id() == xhub_id);
61 ensure(result.ct() == 1);
62 ensure(result.is_gathered());
109 ensure((*
this) == xother);
122 require(xid_spaces.
contains(xindex));
134 ensure(
index() == xindex);
143 const std::string& xname)
147 require(xid_spaces.
contains(xname));
159 ensure(
name() == xname);
181 ensure((*
this) == xother);
219 ensure(&
state() == &xstate);
241 ensure(is_basic_query);
263 ensure(is_basic_query);
293 ensure(is_basic_query);
337 ensure((*
this) == xother);
358 ensure(*result == *
this);
392 ensure(is_basic_query);
virtual singleton_index_space_handle * clone() const
Virtual constructor, makes a new instance of the same type as this. If the handle is attached...
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...
virtual ~singleton_index_space_handle()
Destructor.
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.
static singleton_index_space_handle new_space(index_space_family &xid_spaces, const std::string &xname, pod_type xhub_id)
Create a new singleton id space in the id space family xid_space at the next available id space index...
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
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 bool is_attached() const =0
True if this handle is attached to a state.
Abstract base class with useful features for all objects.
static singleton_index_space_handle new_space(index_space_family &xid_spaces, const std::string &xname, pod_type xhub_id)
Create a new singleton id space in the id space family xid_space with name xname and hub id xhub_id...
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.
virtual bool is_attached() const
True if this handle is attached to a state.
virtual bool invariant() const
Class invariant.
virtual bool invariant() const
Class invariant.
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.
pod_type hub_id() const
The hub id of the singleton id.
singleton_index_space_handle & operator=(const singleton_index_space_handle &xother)
Assignment operator; attach this handle to the state of xother. synonym for attach_to(xother).
An implementation of class explicit_index_space_handle that has a singleton id space state...
bool invariant_check() const
True if invariant checking is enabled.
pod_type hub_id() const
The hub id of the singleton id.
bool contains(pod_type xid) const
True, if this contains an id space with id xid.
An implementation of explicit_index_space_state for an id space containing a single id...
Factory and container for a family of id spaces.
singleton_index_space_state & state()
The singleton id space state (mutable version).
singleton_index_space_handle()
Default constructor.
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.
virtual bool contains(pod_type xid) const
True if this space contains id xid.