21 #include "SheafSystem/explicit_index_space_interval.h" 23 #include "SheafSystem/abstract_product_structure.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/explicit_index_space_state.h" 26 #include "SheafSystem/hub_index_space_handle.h" 27 #include "SheafSystem/index_space_family.h" 28 #include "SheafSystem/index_space_iterator.h" 47 define_old_variable(
size_type old_id_spaces_end = xid_spaces.
end());
50 result_ptr->new_state(xid_spaces, xub);
52 result_ptr->_states.reserve(xub);
58 ensure(&result.
id_spaces() == &xid_spaces);
59 ensure(result.
begin() == old_id_spaces_end);
60 ensure(result.
end() == xid_spaces.
end());
61 ensure(result.
end() == result.
begin() + xub);
165 ensure(is_basic_query);
185 static const std::string result(
"explicit_index_space_interval");
215 sheaf::explicit_index_space_interval::
275 (_begin <= lspace_id) &&
276 (lspace_id <
_end) &&
281 ensure(is_basic_query);
298 (xspace_id <
_end) &&
303 ensure(is_basic_query);
351 ensure((*
this) == xother);
371 ensure(is_basic_query);
420 ensure(is_basic_query);
441 ensure(is_basic_query);
462 ensure(is_basic_query);
479 bool result =
_states[xlocal_id]->contains(xid);
483 ensure(is_basic_query);
500 bool result =
_states[xlocal_id]->contains_unglued_hub(xid);
504 ensure(is_basic_query);
521 bool result =
_states[xlocal_id]->contains(xid, xhub_id);
525 ensure(is_basic_query);
584 bool result =
_states[xlocal_id]->is_persistent();
588 ensure(is_basic_query);
617 _states[xlocal_id]->new_product_structure(xproduct);
638 _states[xlocal_id]->delete_product_structure();
661 _states[xlocal_id]->product_structure();
665 ensure(is_basic_query);
684 _states[xlocal_id]->product_structure();
688 ensure(is_basic_query);
705 bool result =
_states[xlocal_id]->has_product_structure();
709 ensure(is_basic_query);
762 ensure(is_basic_query);
780 contains(local_id) &&
_states[local_id]->allocated_id_space(xid_space);
784 ensure(is_basic_query);
837 ensure(is_basic_query);
859 ensure(is_basic_query);
935 #include "SheafSystem/index_space_family.h" 945 size_t result = xinclude_shallow ?
sizeof(xn) : 0;
958 result += xn.
_states[i]->deep_size(
true);
virtual explicit_index_space_state * explicit_state(pod_type xlocal_id) const
The explicit id space state for id xlocal_id. Returns null if there is no explicit id space for xloca...
virtual pod_type local_scope(pod_type xspace_id) const
Id relative to this collection equivalent to the id space family id xspace_id.
pod_type end() const
The ending index of the id spaces.
index_type ub() const
The upper bound on the storage array. The number of items current allocated in the storage array...
An abstract class that defines the product structure for an id space.
size_type ct() const
The number of items currently in use.
virtual const index_space_family & id_spaces() const
The id space family for this (const version).
An abstract iterator over the ids of an id space.
virtual const std::string & class_name() const
The name of this class.
explicit_states_type _states
The block of explicit_index_space_state.
virtual bool has_product_structure(pod_type xlocal_id) const
True if the id space with id xlocal_id has a product structure.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
virtual void release_id_space_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the iterator pool.
virtual index_space_interval & operator=(const index_space_collection &xother)
Assignment operator.
virtual bool invariant() const
Class invariant.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
virtual bool operator==(const index_space_collection &xother) const
True if this is equivalent to xother.
pod_index_type pod_type
The "plain old data" index type for this.
virtual pod_type pod(pod_type xlocal_id, pod_type xid) const
The pod index in the space with id xlocal_id equivalent to xid in the hub id space.
virtual pod_type unglued_hub_pod(pod_type xlocal_id, pod_type xid) const
The pod index in the unglued hub id space equivalent to xid in the id space with id xlocal_id...
virtual bool contains_unglued_hub(pod_type xlocal_id, pod_type xid) const
True if the space with id xlocal_id contains an id equivalent to xid in the unglued hub id space...
virtual pod_type index() const =0
Index of this space.
virtual bool is_attached() const =0
True if this handle is attached to a state.
virtual bool allocated_id_space_iterator(const index_space_iterator &xitr) const
True if and only if id space iterator xitr was allocated by the iterator pool.
virtual size_type ct(pod_type xlocal_id) const
The number of members for the id space with id xlocal_id.
virtual index_space_handle & get_id_space(pod_type xlocal_id) const
Allocates an id space handle from the handle pool attached to state with id xlocal_id.
Abstract base class with useful features for all objects.
An implemenation of index_space_collection that adds an interface for the interval [begin()...
friend SHEAF_DLL_SPEC size_t deep_size(const explicit_index_space_interval &xn, bool xinclude_shallow)
The deep size of explicit_index_space_interval& xn.
pod_type _begin
Beginning space id of this interval in the id space family scope.
virtual bool operator==(const index_space_collection &xother) const
True if this is equivalent to xother.
An immutable abstract state for a space of alternate integer identifiers (aliases) for a subset of th...
virtual bool supports_persistent_id_spaces() const
True, if this interval supports persistent id spaces.
virtual bool contains_family(pod_type xspace_id) const
True if this collection contains the id space with family id xspace_id.
SHEAF_DLL_SPEC size_t deep_size(const dof_descriptor_array &xp, bool xinclude_shallow=true)
The deep size of the referenced object of type dof_descriptor_array.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
virtual bool is_persistent(pod_type xlocal_id) const
True if the id space with id xlocal_id should be written to disk.
void set_item(index_type xindex, const_reference_type xitem)
Puts the item xitem at index xindex, but will not resize.
virtual void delete_product_structure(pod_type xlocal_id)
Deletes the product structure for the id space with id xlocal_id.
pod_type _end
Ending space id of this interval in the id space family scope.
virtual void release_id_space(index_space_handle &xid_space) const
Returns the id space handle xid_space to the handle pool.
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 explicit_index_space_interval * clone() const
Virtual constructor; create a new instance of the same type at this.
static factory< index_space_interval > & id_space_interval_factory()
A factory for making descendants of this class.
virtual pod_type index() const =0
Index of this space.
An implementation of index_space_interval for an interval of explicit id spaces.
void insert(explicit_index_space_state &xid_space)
Insert the explicit id space xid_space into this interval.
virtual bool allocated_id_space(const index_space_handle &xid_space) const
True if and only if id space handle xid_space was allocated by the handle pool.
virtual bool is_attached() const =0
True if this iterator is attached to a state.
bool invariant_check() const
True if invariant checking is enabled.
virtual explicit_index_space_interval & operator=(const index_space_collection &xother)
Assignment operator.
pod_type index() const
The index of this id space.
int_type pod_index_type
The plain old data index type.
pod_type end() const
Ending space id of this interval in the id space family scope.
virtual ~explicit_index_space_interval()
Destructor.
Factory and container for a family of id spaces.
explicit_index_space_interval()
Default constructor.
virtual pod_type begin(pod_type xlocal_id) const
Beginning id of the space with id xlocal_id.
virtual bool contains(pod_type xlocal_id) const
True if this collection contains the id space with local id xlocal_id.
virtual pod_type end(pod_type xlocal_id) const
Ending id of the space with id xlocal_id.
virtual bool invariant() const
Class invariant.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
pod_type begin() const
Beginning space id of this interval in the id space family scope.
bool is_same_type(const any *other) const
True if other is the same type as this.
virtual void remove(pod_type xlocal_id)
Remove the id space with id xlocal_id.
void enable_invariant_check() const
Enable invariant checking.
virtual const abstract_product_structure & product_structure(pod_type xlocal_id) const
The product structure for the id space with id xlocal_id (const version).
virtual index_space_iterator & get_id_space_iterator(pod_type xlocal_id) const
Allocates an id space iterator from the iterator pool attached to state with id xlocal_id.
bool in_bounds(pod_type xspace_id) const
True if id xspace_id is in the bounds [begin(), end()).
static const explicit_index_space_interval & new_space(index_space_family &xid_spaces, size_type xub)
Create a new interval of id spaces for explicit id spaces in the id space family xid_spaces with uppe...
virtual void new_product_structure(pod_type xlocal_id, const abstract_product_structure &xproduct)
Creates a new product structure for the id space with id xlocal_id by cloning the product structure...