21 #include "SheafSystem/abstract_product_structure.h" 22 #include "SheafSystem/index_space_handle.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/hub_index_space_handle.h" 25 #include "SheafSystem/index_space_family.h" 26 #include "SheafSystem/index_space_iterator.h" 27 #include "SheafSystem/scoped_index.h" 28 #include "SheafSystem/std_iomanip.h" 67 ensure((*
this) == xother);
86 result = result && (
index() == xother.
index());
91 ensure(is_basic_query);
116 ensure(*result == *
this);
167 ensure(is_basic_query);
190 ensure(is_basic_query);
211 ensure(is_basic_query);
234 ensure(is_basic_query);
251 bool result = (
ct() == 0);
255 ensure(is_basic_query);
278 ensure(is_basic_query);
301 ensure(is_basic_query);
318 bool result = (
begin() == 0) && (
end() ==
ct());
322 ensure(is_basic_query);
345 ensure(is_basic_query);
366 ensure(is_basic_query);
387 ensure(is_basic_query);
410 ensure(is_basic_query);
433 ensure(is_basic_query);
454 ensure(is_basic_query);
477 ensure(is_basic_query);
611 ensure(is_basic_query);
688 ensure(is_basic_query);
712 ensure(is_basic_query);
735 ensure(is_basic_query);
769 ensure(is_basic_query);
826 require(!xname.empty());
859 ensure(is_basic_query);
872 require(xid_spaces.
contains(xindex));
884 ensure(
index() == xindex);
897 require(!xname.empty());
898 require(xid_spaces.
contains(xname));
909 ensure(
name() == xname);
936 ensure(
index() == xindex);
963 ensure(
name() == xname);
1017 require(xhost.
contains(xlocal_id));
1027 ensure(&
host() == &xhost);
1061 require(xid_spaces.
contains(xindex));
1070 ensure(is_basic_query);
1080 const std::string& xname)
const 1084 require(xid_spaces.
contains(xname));
1092 ensure(is_basic_query);
1113 ensure(is_basic_query);
1134 ensure(is_basic_query);
1170 ensure(is_basic_query);
1184 require(xhost.
contains(xlocal_id));
1188 bool result =
false;
1194 ensure(is_basic_query);
1250 ensure(is_basic_query);
1267 bool result =
false;
1273 ensure(is_basic_query);
1329 ensure(is_basic_query);
1346 bool result =
false;
1352 ensure(is_basic_query);
1376 require(other != 0);
1439 using namespace std;
1443 xos <<
"index_space:" 1444 <<
" index = " << xi.
index()
1445 <<
" name = \'" << xi.
name() <<
"\'" 1448 xos <<
"ct: " << xi.
ct() << endl;
1449 xos <<
"begin: " << xi.
begin() << endl;
1450 xos <<
"end: " << xi.
end() << endl;
1451 xos <<
"persistent: " << boolalpha << xi.
is_persistent() << noboolalpha << endl;
1457 xos << setw(10) << litr.
pod();
1466 xos << setw(10) << litr.
hub_pod();
1474 xos <<
"index_space: index = -1 name = \'\'" 1493 size_t result = xinclude_shallow ?
sizeof(xn) : 0;
1497 ensure(result >= 0);
virtual bool invariant() const
Class invariant, intended to be redefined in each descendant. See below for template for invariant in...
const index_space_collection * collection(pod_type xid) const
Id space collection for id xid (const version).
virtual void delete_product_structure()=0
Deletes the product structure for this id space.
virtual bool has_product_structure() const =0
True if this id space has a product structure.
virtual bool allocated_id_space() const =0
True if and only if this id space handle was allocated by the handle pool.
std::string name(pod_type xid) const
The name for id xid.
An abstract class that defines the product structure for an id space.
bool is_empty() const
True if there are no ids in the space.
virtual const abstract_product_structure & product_structure() const =0
The product structure for this id space (const version).
virtual pod_type end() const =0
Ending id of this space.
An abstract iterator over the ids of an id space.
pod_type pod() const
The current id in the iteration.
virtual pod_type family_scope(pod_type xlocal_id) const =0
Id relative to the id space family equivalent to the local id xlocal_id.
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...
bool operator==(const index_space_handle &xother) const
True if this is a handle has the same state as xother.
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 =0
The id space family for this (const version).
virtual pod_type unglued_hub_pod(pod_type xid) const =0
The pod index in the unglued hub id space equivalent to xid in this id space.
void put_name(pod_type xid, const std::string &xname)
Associate name xname with id space index xid.
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.
virtual void next()=0
Makes id() the next id in the iteration.
index_space_handle()
Default constructor.
virtual bool is_attached() const =0
True if this handle is attached to a state.
virtual void detach()=0
Detach this handle form its state, if any.
virtual bool contains(pod_type xid) const =0
True if this space contains id xid.
An implementation of class sum_index_space_handle that has a primary sum id space state...
virtual bool contains_glued_hub(pod_type xid) const =0
True if this space contains an id equivalent to xid in the glued hub id space.
const hub_index_space_handle & hub_id_space() const
The hub id space.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
virtual pod_type local_scope(pod_type xspace_id) const =0
Id relative to this collection equivalent to the id space family id xspace_id.
pod_type index(const std::string &xname) const
The index for name xname.
virtual void reset()=0
Restarts the iteration.
Abstract base class with useful features for all objects.
bool is_done() const
True if iteration is finished.
std::string name() const
Name of this space.
pod_index_type pod_type
The "plain old data" index type for this.
virtual void release_iterator(index_space_iterator &xitr) const =0
Returns the id space iterator xitr to the iterator pool.
An index within the external ("client") scope of a given id space.
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.
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.
void put_name(const std::string &xname)
Associate name xname with this id space.
bool conforms_to_state(const index_space_family &xid_spaces, pod_type xindex) const
True if this conforms to the handle type required by the state with index xindex in the id space fami...
virtual pod_type glued_hub_pod(pod_type xid) const =0
The pod index in the hub id space equivalent to xid in this id space. synonym for unglued_hub_pod(xid...
virtual size_type ct() const =0
The number of members.
virtual index_space_handle & operator=(const index_space_handle &xother)
Assignment operator; attach this handle to the state of xother. synonym for attach_to(xother).
virtual const index_space_collection & host() const =0
The host collection.
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...
void attach_to(const index_space_family &xid_spaces, pod_type xindex)
Attach to the state with index xindex in the id space family xid_spaces.
virtual bool contains_unglued_hub(pod_type xid) const =0
True if this space contains an id equivalent to xid in the unglued hub id space.
virtual pod_type pod(pod_type xid) const =0
The pod index in this space equivalent to xid in the hub id space.
virtual bool contains(pod_type xlocal_id) const =0
True if this collection contains the id space with local id xlocal_id.
virtual pod_type begin() const =0
Beginning id of this space.
virtual index_space_iterator & get_iterator() const =0
Allocates an id space iterator from the iterator pool.
virtual bool allocated_iterator(const index_space_iterator &xitr) const =0
True if and only if id space iterator xitr was allocated by the iterator pool.
pod_type hub_pod(pod_type xid) const
The pod index in the unglued hub id space equivalent to xid in this id space; synonym for unglued_hub...
virtual bool is_persistent() const =0
True if this id space should be written to disk.
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 void new_product_structure(const abstract_product_structure &xproduct)=0
Creates a new product structure for this id space by cloning the product structure, xproduct.
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.
virtual index_space_handle * clone() const =0
Virtual constructor, makes a new instance of the same type as this. If the handle is attached...
virtual bool invariant() const
Class invariant.
Factory and container for a family of id spaces.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
virtual ~index_space_handle()
Destructor.
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.
pod_type hub_pod() const
The current unglued hub id in the iteration. synonym for unglued_hub_pod().
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.