21 #include "SheafSystem/namespace_poset_schema.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/array_poset_dof_map.h" 25 #include "SheafSystem/namespace_poset.impl.h" 26 #include "SheafSystem/poset_handle_factory.h" 27 #include "SheafSystem/poset_type.h" 28 #include "SheafSystem/primitives_poset_dof_map.h" 29 #include "SheafSystem/std_iomanip.h" 30 #include "SheafSystem/std_iostream.h" 31 #include "SheafSystem/total_poset_member.h" 32 #include "SheafSystem/tern.h" 48 static const std::string result(
"namespace_poset_schema");
52 ensure(result ==
"namespace_poset_schema");
63 sheaf::namespace_poset_schema::
64 namespace_poset_schema()
80 sheaf::namespace_poset_schema::
85 require(precondition_of(
new state(same args)));
89 new_state(xschema, xauto_access);
93 ensure(postcondition_of(new_state(same args)));
100 sheaf::namespace_poset_schema::
101 ~namespace_poset_schema()
116 sheaf::namespace_poset_schema::
151 return NAMESPACE_POSET_SCHEMA_ID;
162 static const char* result =
"namespace_poset_schema";
179 require(xdof_map != 0);
189 ensure(result ? (dynamic_cast<const primitives_poset_dof_map*>(xdof_map) != 0) :
true);
228 lmbr.
put_name(
"pointer",
true,
false);
236 lmbr.
put_name(
"type_id",
true,
false);
244 lmbr.
put_name(
"class",
true,
false);
252 lmbr.
put_name(
"prereq_id_0",
true,
false);
260 lmbr.
put_name(
"prereq_id_1",
true,
false);
268 lmbr.
put_name(
"prereq_id_2",
true,
false);
276 lmbr.
put_name(
"prereq_id_3",
true,
false);
284 lmbr.
put_name(
"prereq_id_4",
true,
false);
311 for(
int i=0; i<lio_dofs.
ct(); ++i)
361 _table_dof_subposet =
new subposet(
this);
362 _row_dof_subposet =
new subposet(
this);
381 sheaf::namespace_poset_schema::
386 require(xschema != 0);
388 require(dynamic_cast<primitives_poset_schema*>(xschema->
host()) != 0);
397 require(dynamic_cast<primitives_poset_schema*>
398 (xschema->
host()) != 0);
436 schematize(_table_dof_subposet, _row_dof_subposet,
true);
451 delete _table_dof_subposet;
452 _table_dof_subposet = 0;
455 delete _row_dof_subposet;
456 _row_dof_subposet = 0;
544 sheaf::namespace_poset_schema::
virtual void initialize_standard_subposets(const std::string &xname)
Creates the subposets common to every poset (i.e._whole and _jims) plus those required of a schema po...
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...
bool invariant() const
Class invariant.
poset_state_handle * host() const
The poset which this is a handle to a component of.
The schema poset for the namespace.
A client handle for a subposet.
void insert_prototype(const poset_state_handle *xprototype)
Sets xprototype as the prototype for its client class.
virtual void schematize(subposet *xtable_dof_subposet, subposet *xrow_dof_subposet, bool xall_members=false)
Prepare this poset and its top member for use as a schema. If xall_members = true, schematize all other members as well.
bool has_standard_member_ct() const
True if poset is in its initial state, that is, it contains just the standard members.
virtual void new_link(pod_index_type xgreater, pod_index_type xlesser)
Insert a cover link from greater to lesser (that is, hub id xgreater covers hub id xlesser)...
virtual int member_ct() const
The number of members of this poset.
size_type ct() const
The number of items currently in use.
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
virtual void new_jim_state(poset_dof_map *xdof_map=0, bool xcopy_dof_map=false, bool xauto_access=true)
Creates a new jim (join-irreducible member) state in host() and attaches this to it. If xdof_map == 0 a new dof map is created. If xdof_map != 0 and xcopy_dof_map == false, xdof_map is used as the dof map. If xdof_map != 0 and xcopy_dof_map is true, a copy of xdof_map is used.
The private state of a partially ordered set.
virtual const char * class_name() const
The name of this class.
virtual bool row_dof_map_conforms(const poset_dof_map *xdof_map) const
True if xdof_map conforms to (i.e. is derived from) the type of row dof map required by this poset...
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
virtual size_type subposet_ct() const
The number of subposets of this poset.
poset_type
Identifiers for poset types.
virtual void initialize_standard_members()
Creates the members common to every poset, for instance, top() and bottom().
void initialize_table_dofs(void *xtable_dofs, size_t xtable_dof_ub)
Initializes the table dofs ("class variables")
virtual void initialize_standard_subposets(const std::string &xname)
Creates the subposets common to every poset (e.g. whole() and jims()).
void put_standard_row_dof_tuple_ct(int xct)
Sets the number of standard row dof tuples automatically allocated by the constructor.
virtual void get_read_access() const
Get read access to the state associated with this.
const scoped_index & index() const
The index of the component state this handle is attached to.
The general, abstract map from dof ids to dof values.
void put_standard_subposet_ct(int xct)
Sets the number of standard subposets automatically allocated by the constructor. ...
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...
Abstract base class with useful features for all objects.
void push_back(const_reference_type item)
Insert item at the end of the items in the auto_block.
virtual poset_type type_id() const
Identifier for the type of this poset.
bool has_standard_subposet_ct() const
True if poset is in its initial state, that is, it contains just the standard subposets.
void update_standard_member_id_spaces()
Update the initially allocated id spaces.
bool state_is_read_write_accessible() const
True if this is attached and if the state is accessible for read and write or access control is disab...
bool has_standard_row_dof_tuple_ct() const
True if poset is in its initial state, that is, it contains just the standard row_dof_tuples.
A map from schema poset member ids to dof values for primitives_poset members.
virtual void insert_member(pod_index_type xmbr_hub_id)
Inserts the member of host() with hub id xmbr_hub_id.
size_type row_dof_tuple_ct() const
The number of row_dof_tuples of this poset.
virtual void put_name(const std::string &xname, bool xunique, bool xauto_access)
Make xname a name for this; if xunique, make xname the only name.
void put_standard_member_ct(int xct)
Sets the number of standard members automatically allocated by the constructor.
virtual void begin_jim_edit_mode(bool xauto_access=true)
Allow editing of jims and jim order relation.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
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...
static poset_handle_factory & factory()
The poset handle factory.
virtual void detach_from_state()
Detach this handle from its state, if any.
virtual bool is_attached() const
True if this is attached to a state.
poset_state * _state
State object for this poset.
bool invariant_check() const
True if invariant checking is enabled.
virtual void initialize_standard_members()
Initializes the predefined members of the poset.
virtual void end_jim_edit_mode(bool xensure_lattice_invariant=true, bool xauto_access=true)
Prevent editing of jims and jim order relation.
static bool is_valid_name(const std::string &xname)
True if xname is not empty and contains only name legal characters.
An abstract client handle for a member of a poset.
bool in_jim_edit_mode() const
True if editing jims and jim order relation is allowed.
static const std::string & standard_name()
The standard name for an instance of this class.
void enable_invariant_check() const
Enable invariant checking.
bool state_is_not_read_accessible() const
True if this is attached and if the state is accessible for read or if access control is disabled...
virtual bool invariant() const
Class invariant.
virtual void new_jrm_state(bool xauto_access=true)
Creates a new jrm (join-reducible member) state in host() and attaches this to it.
A client handle for an unrestricted member of a poset. A total_poset_member is guaranteed not to be r...