21 #include "SheafSystem/tuple.h" 23 #include "SheafSystem/abstract_poset_member.impl.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/namespace_poset.h" 26 #include "SheafSystem/schema_poset_member.h" 27 #include "SheafSystem/wsv_block.h" 29 #include "SheafSystem/fiber_bundles_namespace.h" 30 #include "SheafSystem/tuple_space.h" 114 const string& result = static_class_name();
118 ensure(!result.empty());
133 static const string result(
"tuple_lite");
137 ensure(!result.empty());
154 int lfactor_ct = factor_ct();
174 require(&xother != 0);
180 bool result =
dynamic_cast<const tuple_lite*
>(&xother) != 0;
202 ensure(is_same_type(*result));
215 if(invariant_check())
219 disable_invariant_check();
223 invariance(any_lite::invariant());
229 enable_invariant_check();
257 static const string result(
"fiber_space_schema");
261 ensure(!result.empty());
277 static const poset_path result(standard_schema_poset_name(),
"tuple_schema");
281 ensure(result.
full());
282 ensure(result.
poset_name() == standard_schema_poset_name());
302 string lmember_names =
"factor_ct INT true";
305 standard_schema_path().member_name(),
306 poset_path(standard_schema_poset_name(),
"bottom"),
331 require(!xhost_path.
empty());
334 require(xschema_path.
full());
336 require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
338 require(xfactor_ct > 0);
343 host_type::new_table(xns, xhost_path, xschema_path, xfactor_ct, xauto_access);
347 ensure(xns.
owns(result, xauto_access));
348 ensure(result.
path(
true) == xhost_path);
350 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
352 ensure(result.
factor_ct(
true) == xfactor_ct);
395 attach_to_state(xhost, xhub_id);
401 ensure(index() == xhub_id);
402 ensure(is_attached());
416 attach_to_state(xhost, xid.
hub_pod());
422 ensure(index() ==~ xid);
423 ensure(is_attached());
434 require(!xname.empty());
439 attach_to_state(xhost, xname);
445 ensure(name() == xname);
446 ensure(is_attached());
456 require(xother != 0);
458 require(abstract_poset_member::is_ancestor_of(xother));
462 attach_to_state(xother);
467 ensure(is_attached());
468 ensure(is_same_state(xother));
479 require(precondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
483 new_jim_state(xhost, 0,
false, xauto_access);
487 ensure(postcondition_of(new_jim_state(xhost, 0,
false, xauto_access)));
500 require(is_ancestor_of(&xother));
501 require(precondition_of(attach_to_state(&xother)));
505 attach_to_state(&xother);
509 ensure(postcondition_of(attach_to_state(&xother)));
522 require(precondition_of(attach_to_state(&xother)));
526 attach_to_state(&xother);
530 ensure(postcondition_of(attach_to_state(&xother)));
555 require(state_is_read_accessible());
559 int result = host()->factor_ct();
574 require(state_is_auto_read_accessible(xauto_access));
578 int result = host()->factor_ct();
593 require(xrequire_write_access ?
594 state_is_read_write_accessible() :
595 state_is_read_accessible());
596 require(is_jim(
false));
605 ensure(is_basic_query);
618 require(xrequire_write_access ?
619 state_is_read_write_accessible() :
620 state_is_read_accessible());
621 require(is_jim(
false));
630 ensure(is_basic_query);
645 require(xdof_map != 0);
676 const string& result = static_class_name();
680 ensure(!result.empty());
695 static const string result(
"tuple");
699 ensure(!result.empty());
738 return reinterpret_cast<host_type*
>(_host);
745 return dynamic_cast<const host_type*
>(xother) != 0;
763 bool result =
dynamic_cast<const tuple*
>(xother) != 0;
786 invariance(total_poset_member::invariant());
788 if (invariant_check())
792 disable_invariant_check();
798 enable_invariant_check();
803 ensure(is_derived_query);
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 ...
static const poset_path & standard_schema_path()
The path of the schema required by this class.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, int xfactor_ct, bool xauto_access)
Creates a new host table for members of this type. The poset is created in namespace xns with path xh...
virtual ~tuple()
Destructor.
bool full() const
True if both poset name and member name are not empty.
Table dofs type for class tuple_table_dofs_type.
virtual array_poset_dof_map & dof_map(bool xrequire_write_access=false)
The map from client_ids to dof values for this poset member (mutable version)
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.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
virtual bool invariant() const
Class invariant.
virtual const std::string & class_name() const
The name of this class.
bool contains_poset_member(pod_index_type xposet_hub_id, pod_index_type xmember_hub_id, bool xauto_access=true) const
True if this contains a poset with hub id xposet_hub_id which contains a member with hub id xmember_h...
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
A client handle for a general, abstract partially order set.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
host_type * host() const
The poset this is a member of.
A Cartesian product space.
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.
The general, abstract map from dof ids to dof values.
virtual int factor_ct() const
Number of factors (components) in tuple.
Abstract base class with useful features for all volatile objects.
Abstract base class with useful features for all objects.
virtual const std::string & class_name() const
The name of this class.
static const std::string & standard_schema_poset_name()
The name of the standard schema poset for this class.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
tuple_lite()
Default constructor.
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 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)
virtual void detach_from_state()
Detach this handle from its state, if any.
An index within the external ("client") scope of a given id space.
virtual bool is_attached() const
True if this handle is attached to a non-void state.
static const std::string & static_class_name()
The name of this class.
std::string poset_name() const
The poset name part of the path.
A member of a Cartesian product space; a tuple of attributes (volatile version).
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
virtual bool contains_member(pod_index_type xmbr_hub_id, bool xauto_access=true) const
True if some version of this poset contains poset member with hub id xmbr_hub_id. ...
A member of a Cartesian product space; a tuple of attributes (persistent version).
virtual tuple & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
bool empty() const
True if both poset name and member name are empty.
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
bool invariant() const
Class invariant.
virtual bool host_is_ancestor_of(const poset_state_handle *other) const
True if other conforms to host.
virtual ~tuple_lite()
Destructor.
table_dofs_type table_dofs() const
The table dofs.
tuple()
Default constructor.
static const std::string & static_class_name()
The name of this class.
int_type pod_index_type
The plain old data index type.
virtual tuple_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
void tuple(pod_index_type x, size_type xj_ub, pod_index_type &xi, pod_index_type &xj)
Ordinal to 2-tuple conversion.
virtual tuple * clone() const
Make a new handle, no state instance of current.
An abstract client handle for a member of a poset.
An array representation of abstract class poset_dof_map.
Namespace for the fiber_bundles component of the sheaf system.
int factor_ct() const
The number of factors in this product.
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.
tuple_lite & operator=(const tuple_lite &xother)
Assignment operator.
bool is_ancestor_of(const any *other) const
True if other conforms to current.
virtual bool dof_map_is_ancestor_of(const poset_dof_map *xdof_map) const
True if xdof_map conforms to (is derived from) the type of dof map required by this handle...
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.