20 #include "SheafSystem/id_block.h" 22 #include "SheafSystem/any.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/error_message.h" 25 #include "SheafSystem/hub_index_space_handle.h" 26 #include "SheafSystem/poset_state_handle.h" 45 bool result =
dynamic_cast<const id_block*
>(other) != 0;
68 ensure(unexecutable(
"is_same_type(result)"));
71 ensure(result->
ub() == 0);
120 invariance(
host().is_attached());
144 _host = xother._host;
192 require((0 <= xct) && (xct <= xub));
193 require((xids != 0) == (xct > 0));
202 ensure(&
host() == &xhost);
206 ensure_for_all(i, 0, xct,
item(i) == xids[i]);
245 require(xauto_access ||
host().state_is_read_accessible());
246 require(
host().member_id_spaces(xauto_access).contains(xnew_id_space.
index()));
255 if(xnew_id_space == (*_id_space))
271 for(
int i=0; i<
_ct; ++i)
273 item(i).put(xnew_id_space,
item(i).hub_pod());
280 for(
int i=0; i<
_ct; ++i)
282 item(i).put(xnew_id_space, xnew_id_space.
pod(
item(i).hub_pod()));
296 ensure(
id_space() == xnew_id_space);
310 require(xauto_access ||
host().state_is_read_accessible());
318 ensure(
id_space() ==
host().member_hub_id_space(xauto_access));
340 ensure(result == (&
id_space() == &
host().member_hub_id_space(
true)));
394 xos <<
"host name: " << xblk.
host().
name()
virtual void get_read_write_access(bool xrelease_read_only_access=false)
Get read write access to the state associated with this. If release_read_only_access is requested...
virtual id_block * clone() const
Virtual constructor, makes a new instance of the same type as this.
index_type ub() const
The upper bound on the storage array. The number of items current allocated in the storage array...
size_type ct() const
The number of items currently in use.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
void put_id_space(const index_space_handle &xnew_id_space, bool xauto_access)
Sets space() to xid_space and translates the ids.
block & operator=(const block &xother)
Assignment operator.
A client handle for a general, abstract partially order set.
id_block & operator=(const id_block &xother)
Assignment operator.
void put_member_id_space(bool xauto_access)
Sets space() to host().member_id_space() and translates the ids.
const index_space_family & member_id_spaces(bool xauto_access) const
Collection of member id spaces for this (const version).
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
virtual void release_id_space() const =0
Returns this id space handle to the handle pool.
virtual index_space_handle & get_id_space() const =0
Allocates an id space handle from the handle pool attached to the same id space.
virtual pod_type index() const =0
Index of this space.
block(index_type xub=0)
Creates an instance with ub() == xub; storage is uninitialized.
reference_type item(index_type xindex) const
The item at index xindex.
Abstract base class with useful features for all objects.
std::string name() const
Name of this space.
An index within the external ("client") scope of a given id space.
virtual bool invariant() const
Class invariant.
virtual std::string name() const
The name of this poset.
virtual void release_access(bool xall=false) const
Release access. If xall is true, release all levels of access. Otherwise, release one level of access...
virtual ~id_block()
Destructor.
virtual pod_type pod(pod_type xid) const =0
The pod index in this space equivalent to xid in the hub id space.
size_type _ct
The number of items currently stored.
const hub_index_space_handle & member_hub_id_space(bool xauto_access) const
The member hub id space.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
virtual bool is_attached() const
True if this is attached to a state.
bool is_member_hub_id_space() const
True if space() == host().member_hub_id_space().
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
bool contains(pod_type xid) const
True, if this contains an id space with id xid.
poset_state_handle & host()
The poset that id_space resides in (mutable version).
An auto_block with a no-initialization initialization policy.
A block of ids all in the same id space.
const index_space_handle & id_space() const
The id space the ids in this block belong to.