21 #include "SheafSystem/offset_index_space_handle.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/index_space_family.h" 24 #include "SheafSystem/offset_index_space_state.h" 35 const std::string& xname,
41 require(!xname.empty());
42 require(!xid_spaces.
contains(xname));
43 require(xoffset >= 0);
56 ensure(&result.
id_spaces() == &xid_spaces);
60 ensure(result.
name() == xname);
63 ensure(result.
offset() == xoffset);
64 ensure(result.
ct() == xct);
112 ensure((*
this) == xother);
125 require(xid_spaces.
contains(xindex));
137 ensure(
index() == xindex);
146 const std::string& xname)
150 require(xid_spaces.
contains(xname));
162 ensure(
name() == xname);
184 ensure((*
this) == xother);
222 ensure(&
state() == &xstate);
244 ensure(is_basic_query);
266 ensure(is_basic_query);
296 ensure(is_basic_query);
329 ensure((*
this) == xother);
350 ensure(*result == *
this);
384 ensure(is_basic_query);
static offset_index_space_handle new_space(index_space_family &xid_spaces, const std::string &xname, pod_type xoffset, size_type xct)
Create a new offset id space in the id space family xid_space at the next available id space index wi...
pod_type offset() const
The offset into the hub id space.
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.
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 bool is_persistent() const
True if this id space should be written to disk.
An implementation of class explicit_index_space_handle that has a offset id space state...
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.
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 offset_index_space_handle * clone() const
Virtual constructor, makes a new instance of the same type as this. If the handle is attached...
bool is_gathered() const
True if begin() == 0 and end() == ct().
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
virtual bool invariant() const
Class invariant.
A computed implementation of abstract class explicit_index_space_state. This representation assumes t...
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...
offset_index_space_state & state()
The offset id space state (mutable version).
virtual bool contains(pod_type xlocal_id) const =0
True if this collection contains the id space with local id xlocal_id.
bool invariant_check() const
True if invariant checking is enabled.
offset_index_space_handle & operator=(const offset_index_space_handle &xother)
Assignment operator; attach this handle to the state of xother. synonym for attach_to(xother).
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
virtual bool invariant() const
Class invariant.
bool contains(pod_type xid) const
True, if this contains an id space with id xid.
virtual size_type ct() const
The number of members.
Factory and container for a family of id spaces.
static offset_index_space_handle new_space(index_space_family &xid_spaces, const std::string &xname, pod_type xoffset, size_type xct)
Create a new offset id space in the id space family xid_space with name xname, offset xoffset and cou...
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.
pod_type offset() const
The offset into the hub id space.
offset_index_space_handle()
Default constructor.
virtual ~offset_index_space_handle()
Destructor.