21 #include "SheafSystem/crg_interval.h" 23 #include "SheafSystem/arg_list.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/factory.h" 26 #include "SheafSystem/index_space_family.h" 27 #include "SheafSystem/index_space_iterator.h" 28 #include "SheafSystem/list_index_space_handle.h" 29 #include "SheafSystem/list_index_space_state.h" 30 #include "SheafSystem/poset_crg_state.h" 31 #include "SheafSystem/poset_path.h" 44 _id_spaces_initialized(false),
45 _local_id_space_initialized(false),
46 _lower_covers_initialized(false),
48 _upper_covers_initialized(false),
71 explicit_cover_map_type::const_iterator itr;
72 for(itr = llower_cover_map.begin();
73 itr != llower_cover_map.end();
80 for(itr = lupper_cover_map.begin();
81 itr != lupper_cover_map.end();
301 ensure(!result.empty());
376 explicit_cover_map_type::const_iterator litr =
381 result = litr->second;
408 ensure(is_basic_query);
530 result = lid_space.
index();
575 string suffix = xlower ?
"_lower_cover" :
"_upper_cover";
581 ensure(!result.empty());
680 static const string result(
"crg_interval");
708 bool result =
dynamic_cast<const crg_interval*
>(other) != 0;
781 os <<
"interval begin: " << m.
begin()
782 <<
" interval end: " << m.
end()
783 <<
" interval size: " << m.
size()
798 result = xinclude_shallow ?
sizeof(xp) : 0;
virtual bool invariant() const
Class invariant, intended to be redefined in each descendant. See below for template for invariant in...
void initialize(const namespace_poset &xnamespace)
Sets is_initialized() == true; dummy routine provided to satisfy factory template.
virtual void attach_to(pod_type xindex)
Attach to the state with index xindex in the id space family id_spaces().
index_space_family * _id_spaces
The id space family of this interval.
virtual pod_type index() const
Index of this space.
crg_interval()
Default Constructor; constructs an uninitialized interval.
An abstract iterator over the ids of an id space.
const hub_index_space_handle & hub_id_space() const
The hub id space of this interval.
The default name space; a poset which contains other posets as members.
pod_index_type _lower_covers_begin
The offset into the id space family for the interval of lower covers.
bool _lower_covers_initialized
True if and only if the lower cover is initialized.
bool _local_id_space_initialized
True if local id space has been initialized.
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...
static list_index_space_handle new_space(index_space_family &xid_spaces, const std::string &xname, bool xis_persistent)
Create a new list id space in the id space family xid_space at the next available id space index with...
explicit_cover_map_type & explicit_cover_map(bool xlower)
The lower (xlower true) or upper (xlower false) map to explicit cover id spaces.
void initialize_covers()
Initialize the upper and lower covers for this interval.
An map implementation of class scattered_insertion_index_space_handle. This representation is intende...
bool _upper_covers_initialized
True if and only if the upper cover is initialized.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
primary_index_space_handle _local_id_space
The id space of this interval.
pod_index_type begin() const
The beginning of the member interval; this emulates members in the interval [begin(), end()), includes interval member.
virtual void next()=0
Makes id() the next id in the iteration.
virtual void initialize_lower_covers()=0
Initialize the lower covers for this interval.
virtual ~crg_interval()
Destructor.
static std::string explicit_cover_name(bool xlower, const scoped_index &xmbr_index)
Creates a name for the explicit cover id space for member with index, xmbr_index. ...
void initialize_local_id_space(const index_space_handle &xlocal_id_space)
Sets the local id space to xlocal_id_space and initializes local ids.
An implementation of class sum_index_space_handle that has a primary sum id space state...
pod_index_type cover_id_space_id(bool xlower, pod_index_type xmbr_index) const
The id for the lower (xlower true) or upper (xlower false) cover id space with index xmbr_index...
index_space_iterator & get_id_space_iterator(const std::string &xname) const
Allocates an id space iterator from the iterator pool attached to state with name xname...
void initialize_id_spaces(index_space_family &xid_spaces)
Set the index space family to xid_spaces.
virtual pod_type pod(pod_type xid) const
The pod index in this space equivalent to xid in the hub id space.
An implementation of class explicit_index_space_handle that has a primary id space state...
bool is_hub_scope() const
True if and only if the id space of this is the hub id space.
bool local_id_space_initialized() const
True if local id space has been initialized.
virtual bool invariant() const
Class invariant.
Abstract base class with useful features for all objects.
pod_index_type _upper_covers_begin
The offset into the id space family for the interval of upper covers.
bool handle_conforms_to_state(const std::string &xname) const
True if handle of type T conforms to the state with name xname.
Abstract emulator for an interval of cover relation graph members.
bool is_done() const
True if iteration is finished.
pod_index_type end() const
The end of the member interval.
A factory for instanting descendants of an abstract type T, given the class name of the descendant...
void release_id_space_iterator(index_space_iterator &xitr) const
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.
virtual void initialize_upper_covers()=0
Initialize the upper cover for this interval.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
bool _id_spaces_initialized
True if the id space family has been initialized.
const bool UPPER
Selector for upper cover.
void put(const index_space_handle &xid_space, pod_type xpod)
Set the scope to id space, xid_space and pod() to xpod.
virtual bool is_initialized() const
True if fully initialized.
bool contains_member(pod_index_type xindex) const
True if and only if the index xindex is contained in this interval.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
const index_space_family & id_spaces() const
The id space family for this interval.
void delete_space(pod_type xid)
Delete the id space with index xid.
const bool LOWER
Selector for lower cover.
static crg_interval * new_interval(const std::string &xname)
Creates a default constructed instance of the the class with name xname.
size_type size() const
The number of members in the member interval.
virtual crg_interval * clone() const =0
Virtual constructor, makes a new instance of the same type as this.
bool invariant_check() const
True if invariant checking is enabled.
static factory< crg_interval > & interval_factory()
A factory for making descendants of this class.
static std::string local_id_space_name(pod_index_type xindex)
The reserved name for the local id space of the ramge member with index xindex.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
int_type pod_index_type
The plain old data index type.
bool id_spaces_initialized() const
True if the index space family has been initialized.
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
A handle for a scattered_insertion_index_space_state.
virtual pod_type end() const
Ending id of this space.
void push_back(const scoped_index &xhub_id)
Make the next id in this space equivalent to xhub_id in the hub id space. synonym for push_back(xhub_...
virtual size_type ct() const
The number of members.
virtual const std::string & class_name() const
The name of this class; provided to satisfy factory template.
Factory and container for a family of id spaces.
const primary_index_space_handle & local_id_space() const
The local id space of this interval.
bool cover_is_explicit(bool xlower, pod_index_type xmbr_index) const
True if and only if the lower (xlower true) or upper (xlower false) cover with index xmbr_index is ex...
unordered::unordered_map< pod_index_type, pod_index_type > explicit_cover_map_type
The type of the explicit cover maps..
pod_type offset() const
The offset into the hub id space.
bool covers_initialized(bool xlower) const
True if and only if the lower (xlower true) or upper (xlower false) covers has been initialized for t...
pod_index_type force_explicit_cover(bool xlower, pod_index_type xmbr_index, bool xinitialize=true)
The explicit lower (xlower true) or upper (xlower false) cover id space of the member with index xmbr...
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
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().
static std::string make_reserved_name(const std::string &xprefix, const size_t &xindex, const std::string &xsuffix)
Creates a string reserved_prefix()_xprefix_xindex_xsuffix.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.