21 #include "SheafSystem/sec_rep_descriptor_poset.h" 23 #include "SheafSystem/abstract_poset_member.impl.h" 24 #include "SheafSystem/base_space_poset.h" 25 #include "SheafSystem/array_poset_dof_map.h" 26 #include "SheafSystem/fiber_bundles_namespace.h" 27 #include "SheafSystem/namespace_poset.impl.h" 28 #include "SheafSystem/poset_handle_factory.h" 29 #include "SheafSystem/sec_rep_descriptor.h" 30 #include "SheafSystem/wsv_block.h" 49 const poset_path& result = sec_rep_descriptor::standard_schema_path();
53 ensure(result.
full());
75 require(!xpath.
empty());
78 require(xschema_path.
full());
80 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path(), xauto_access));
82 require(!xprototypes_path.
empty());
91 table_type* ltable =
new table_type();
106 lmap->
put_dof(
"prototypes_path", xprototypes_path);
110 ltable->new_state(xns, xpath, lschema, *lmap);
121 ensure(xns.
owns(result, xauto_access));
122 ensure(result.
path(
true) == xpath);
124 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
126 ensure(result.
prototypes().
path(xauto_access) == xprototypes_path);
181 ensure(!is_attached());
211 poset_type ltype = SEC_REP_DESCRIPTOR_POSET_ID;
250 return SEC_REP_DESCRIPTOR_POSET_ID;
261 static const char* result =
"sec_rep_descriptor_poset";
276 require(is_attached());
280 define_old_variable(
int old_access_request_depth = access_request_depth());
282 _prototypes->get_read_access();
284 poset::get_read_access();
288 ensure(state_is_read_accessible());
289 ensure(access_request_depth() == old_access_request_depth + 1);
290 ensure(prototypes().state_is_read_accessible());
303 require(is_attached());
304 require(!xrelease_read_only_access ? state_is_not_read_only_accessible() :
true);
309 define_old_variable(
int old_access_request_depth = access_request_depth());
311 _prototypes->get_read_access();
313 poset::get_read_write_access(xrelease_read_only_access);
317 ensure(state_is_read_write_accessible());
318 ensure(access_request_depth() == old_access_request_depth + 1);
319 ensure(prototypes().state_is_read_accessible());
332 require(state_is_read_accessible());
336 define_old_variable(
int old_access_request_depth = access_request_depth());
348 _prototypes->release_access(
false);
350 poset::release_access(
false);
352 while(xall && state_is_read_accessible());
357 ensure(!xall ? access_request_depth() == old_access_request_depth - 1 :
358 access_request_depth() == 0);
359 ensure(access_request_depth() == 0 ? state_is_not_read_accessible() :
true);
360 ensure(unexecutable(
"schema, and prototypes access released"));
375 require(state_is_read_accessible());
385 poset_path lprototypes_path(ldofs.prototypes_path);
390 ensure(prototypes().is_attached());
406 require(state_is_read_accessible());
407 require(name_space()->state_is_read_accessible());
411 poset::attach_handle_data_members();
423 ensure(prototypes().is_attached());
436 require(state_is_read_write_accessible());
440 define_old_variable(
int old_prototypes_access_request_depth = prototypes().access_request_depth());
451 string prototypes_name(prototypes().name());
453 #ifdef DIAGNOSTIC_OUTPUT 454 cout <<
"poset: " << name() << endl
455 <<
"\trep: " << prototypes_name
456 <<
" old lvl:" << old_prototypes_access_request_depth << endl
459 int old_access_request_depth = access_request_depth();
460 for(
size_type i=0; i<old_access_request_depth; ++i)
462 prototypes().release_access(
false);
465 define_old_variable(
int prototypes_access_request_depth = prototypes().access_request_depth());
467 #ifdef DIAGNOSTIC_OUTPUT 468 cout <<
" \tprototypes lvl:" << prototypes_access_request_depth << endl;
473 poset::terminate_access();
477 ensure(!is_attached());
478 ensure(unexecutable(
"state has been deleted"));
479 ensure(prototypes_access_request_depth ==
480 (old_prototypes_access_request_depth - old_access_request_depth));
509 result = schema().host()->index().pod();
512 result = _prototypes->index().pod();
572 ensure(is_same_type(result));
585 if(invariant_check())
589 disable_invariant_check();
593 invariance(poset::invariant());
599 enable_invariant_check();
sec_rep_descriptor_poset()
Creates an unattached handle.
virtual poset_path path(bool xauto_access=true) const
The path of this poset.
bool state_is_auto_read_write_accessible(bool xauto_access) const
True if state is auto accessible for read and write, that is, if the state is already accessible for ...
Table dofs type for class sec_rep_descriptor_poset.
bool full() const
True if both poset name and member name are not empty.
poset_path path(bool xauto_access=true) const
A path to this component.
The default name space; a poset which contains other posets as members.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
bool path_is_auto_read_accessible(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath exists and is auto read accessible.
poset_type
Identifiers for poset types.
virtual void terminate_access()
Release all access to posets this depends on, then detach and delete the state.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
virtual void initialize_handle_data_members(const namespace_poset &xns)
Initializes the handle data members that depend on the table dofs and are required to get access when...
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
virtual void get_read_access() const
Get read access to the state associated with this.
poset_state_handle & member_poset(pod_index_type xhub_id, bool xauto_access=true) const
The poset_state_handle object referred to by hub id xhub_id.
virtual sec_rep_descriptor_poset * clone() const
Virtual constructor, makes a new instance of the same type as this.
The poset for sec_rep_descriptors.
virtual bool invariant() const
Class invariant.
virtual poset_type type_id() const
Identifier for the type of this poset.
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.
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
const base_space_poset & prototypes() const
The base space members prototypes poset.
A factory for instanting descendants of an abstract type T, given the class name of the descendant...
virtual const char * class_name() const
The name of this class.
bool owns(const poset_state_handle &xposet, bool xauto_access) const
True if and only if this contains the poset xposet. synonym for contains_poset(xposet.poset_path(true), xauto_access)
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
virtual pod_index_type prereq_id(int xi) const
The id of the xi-th prerequisite poset for this.
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
static sec_rep_descriptor_poset & new_table(namespace_type &xhost, const poset_path &xpath, const poset_path &xschema_path, const poset_path &xprototypes_path, bool xauto_access)
Creates a new sec_rep_descriptor_poset in namespace xns with path xpath, schema specified by xschema_...
virtual ~sec_rep_descriptor_poset()
Destructor.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
bool empty() const
True if both poset name and member name are empty.
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 bool make_prototype()
Creates prototype for this class and enters in in factory.
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...
virtual void get_read_access() const
Get read access to the state associated with this.
virtual void put_dof(pod_index_type xdof_id, const void *xdof, size_type xdof_size)
Sets the dof referred to by xdof_id to the value at xdof.
T::table_dofs_type & table_dofs(T &x0)
The table dofs pod type for x0 (mutable version).
int_type pod_index_type
The plain old data index type.
c_string prototypes_path
The base space prototypes path.
void insert_prototype(T *xprototype)
Sets xprototype as the prototype for its client class.
An array representation of abstract class poset_dof_map.
virtual void attach_handle_data_members()
Initializes the handle data members when this handle is attached to a state.
Namespace for the fiber_bundles component of the sheaf system.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
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...
A client handle for a poset member which has been prepared for use as a schema.