20 #include "SheafSystem/poset_state.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/poset_crg_state.h" 24 #include "SheafSystem/poset_powerset_state.h" 25 #include "SheafSystem/poset_table_state.h" 26 #include "SheafSystem/schema_poset_member.h" 27 #include "SheafSystem/subposet.h" 40 require(xschema != 0 ? xschema->
is_attached() :
true);
77 ensure(!
crg()->jim_edit_mode());
79 ensure(
powerset()->subposet_member_index_ub() >=
crg()->end());
80 ensure(xschema != 0 ?
table()->schema().is_same_state(xschema) :
true);
189 ensure(
name() == xname);
300 result =
dynamic_cast<const poset_state*
>(xother) != 0;
390 result = xinclude_shallow ?
sizeof(xp) : 0;
396 size_t lmemory_parts[2];
397 size_t lcrg_result =
deep_size(*lxp.crg(),
true, lmemory_parts);
398 result += lcrg_result;
402 xresults[0] = lmemory_parts[0];
403 xresults[1] = lmemory_parts[1];
406 else if(xresults != 0)
412 if(lxp.powerset() != 0)
414 size_t lpowerset_result =
deep_size(*lxp.powerset(),
true);
415 result += lpowerset_result;
418 xresults[2] = lpowerset_result;
420 else if(xresults != 0)
427 size_t ltable_result =
deep_size(*lxp.table());
428 result += ltable_result;
431 xresults[3] = ltable_result;
433 else if(xresults != 0)
virtual bool is_ancestor_of(const any *other) const
True if other conforms to current.
virtual bool invariant() const
Class invariant.
The data structure representing the cover relation graph of a poset.
The private state of a partially ordered set.
poset_crg_state * crg()
/// The name of the type of poset.
virtual poset_state * clone() const
Make a new instance of the same type as this.
poset_type
Identifiers for poset types.
poset_state()
Default constructor; private to disable default construction.
poset_type type_id() const
Identifier for the type of this poset.
virtual bool invariant() const
Class invariant.
poset_table_state * table() const
Table (dof tuples).
void put_name(const std::string &xname)
Sets name() to xname.
Abstract base class with useful features for all objects.
poset_powerset_state * powerset()
Set of subposets (powerset)
virtual bool invariant() const
Class invariant.
friend SHEAF_DLL_SPEC size_t deep_size(const poset_state &xp, bool xinclude_shallow, size_t xresults[4])
The deep size of the referenced object of type poset_state. if xinclude_shallow, add the sizeof xp to...
const scoped_index & end() const
The end of the member interval; members have indices in the interval [begin(), end()).
virtual bool is_attached() const
True if this handle is attached to a non-void state.
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.
const std::string & name() const
The name of this poset.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
poset_crg_state * _crg
The cover relation graph for this poset.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
bool invariant_check() const
True if invariant checking is enabled.
bool invariant() const
Class invariant.
poset_powerset_state * _powerset
The set of subposets for this poset .
~poset_state()
Destructor.
virtual bool invariant() const
Class invariant.
std::string _name
The name of this poset.
static bool is_valid_name(const std::string &xname)
True if xname is not empty and contains only name legal characters.
poset_type _type_id
Identifier for the type of poset.
An abstract client handle for a member of a poset.
poset_table_state * _table
The table of dof tuples for this poset.
The set of subsets of a poset.
void enable_invariant_check() const
Enable invariant checking.
const scoped_index & subposet_member_index_ub() const
Upper bound of member index in each subposet.
The data structure representing the table containing the dof tuples of the members of a poset...