21 #include "SheafSystem/sec_tuple.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/binary_section_space_schema_member.impl.h" 25 #include "SheafSystem/binary_section_space_schema_poset.h" 26 #include "SheafSystem/fiber_bundles_namespace.h" 27 #include "SheafSystem/section_space_schema_member.impl.h" 28 #include "SheafSystem/section_space_schema_poset.h" 29 #include "SheafSystem/sec_tuple_space.impl.h" 30 #include "SheafSystem/tuple.h" 31 #include "SheafSystem/tuple_space.h" 57 static const poset_path result(
"sec_rep_descriptors",
"vertex_element_dlinear");
61 ensure(result.
full());
78 require(!xhost_path.
empty());
81 require(xschema_path.
full());
83 require(host_type::fiber_space_conforms<fiber_type::host_type>(xns, xschema_path, xauto_access));
88 host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xauto_access);
92 ensure(xns.
owns(result, xauto_access));
93 ensure(result.
path(
true) == xhost_path);
95 ensure(result.
schema(
true).
path(xauto_access) == xschema_path);
140 attach_to_state(xhost, xhub_id);
146 ensure(index() == xhub_id);
147 ensure(is_attached());
148 ensure(!is_restricted());
162 attach_to_state(xhost, xid.
hub_pod());
168 ensure(index() ==~ xid);
169 ensure(is_attached());
170 ensure(!is_restricted());
180 require(!xname.empty());
185 attach_to_state(xhost, xname);
191 ensure(name() == xname);
192 ensure(is_attached());
193 ensure(!is_restricted());
207 require(precondition_of(attach_to_state(same args)));
211 attach_to_state(xnamespace, xpath, xauto_access);
215 ensure(postcondition_of(attach_to_state(same args)));
227 require(xother != 0);
231 attach_to_state(xother);
236 ensure(is_attached());
237 ensure(is_same_state(xother));
238 ensure(is_same_restriction(xother));
247 require(precondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
251 new_jim_state(xhost, xdof_map,
false, xauto_access);
255 ensure(postcondition_of(new_jim_state(xhost, xdof_map,
false, xauto_access)));
265 int xbase_version,
bool xauto_access)
269 require(precondition_of(\
270 new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
274 new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access);
278 ensure(postcondition_of(\
279 new_jim_state(xhost, xbase_mbr, xbase_version, xauto_access)));
292 require(is_ancestor_of(&xother));
293 require(precondition_of(attach_to_state(&xother)));
297 attach_to_state(&xother);
301 ensure(postcondition_of(attach_to_state(&xother)));
314 require(precondition_of(attach_to_state(&xother)));
318 attach_to_state(&xother);
322 ensure(postcondition_of(attach_to_state(&xother)));
346 require(state_is_read_accessible());
350 int result = host()->factor_ct();
365 require(state_is_auto_read_accessible(xauto_access));
369 int result = host()->factor_ct();
397 const string& result = static_class_name();
401 ensure(!result.empty());
416 static const string result(
"sec_tuple");
420 ensure(!result.empty());
465 return reinterpret_cast<host_type*
>(_host);
472 return dynamic_cast<const host_type*
>(xother) != 0;
492 require(xother != 0);
499 bool result =
dynamic_cast<const tuple*
>(xother) != 0;
518 require(xother != 0);
525 bool result =
dynamic_cast<const sec_tuple*
>(xother) != 0;
549 invariance(sec_rep_space_member::invariant());
551 if (invariant_check())
555 disable_invariant_check();
560 enable_invariant_check();
565 ensure(is_derived_query);
585 require(state_is_read_accessible());
590 sec_rep_space_member::attach_handle_data_members();
594 ensure(!is_restricted());
609 sec_rep_space_member::detach_from_state();
613 ensure(!is_attached());
625 require(0 <= i && i < df());
651 require(0 <= i && i < df());
652 require(component != 0);
662 ensure(comp(i) == component);
673 require(state_is_read_accessible());
674 require(xschema != 0);
675 require(schema().is_ancestor_of(xschema));
676 require(xschema != 0);
677 require(xschema->
le(&(host()->schema())));
683 sec_rep_space_member::restrict_to(xschema);
687 ensure(schema().is_same_state(xschema));
688 ensure(unexecutable(
"base().is_same_state(old base())"));
700 require(state_is_read_accessible());
712 sec_rep_space_member::restrict_to(xbase_id, xfiber_schema_id);
729 require(state_is_read_accessible());
731 require(xbase->
le(&(host()->base())));
732 require(xfiber_schema != 0);
733 require(xfiber_schema->
le(&(host()->fiber_schema())));
739 sec_rep_space_member::restrict_to(xbase, xfiber_schema);
743 ensure(base().is_same_state(xbase));
744 ensure(fiber_schema().is_same_state(xfiber_schema));
756 require(state_is_read_accessible());
757 require(xother != 0);
759 require(is_ancestor_of(xother));
760 require(has_same_host(xother));
766 sec_rep_space_member::restrict_to_same(xother);
770 ensure(is_same_restriction(xother));
782 require(state_is_read_accessible());
788 sec_rep_space_member::unrestrict();
792 ensure(!is_restricted());
virtual bool invariant() const
Class invariant, intended to be redefined in each descendant. See below for template for invariant in...
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 ...
virtual sec_tuple * clone() const
Make a new handle, no state instance of current.
void unrestrict()
Removes any restriction to this handle and its components; restores base and fiber to the base and fi...
bool full() const
True if both poset name and member name are not empty.
virtual sec_tuple & operator=(const abstract_poset_member &xother)
Assignment operator; synonym for attach_to_state(&xother).
A Cartesian product section space.
The abstract map from section dof ids to section dof values of heterogeneous type.
poset_path path(bool xauto_access=true) const
A path to this component.
virtual const std::string & class_name() const
The name of this class.
A section of a bundle with fiber type tuple.
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...
A client handle for a general, abstract partially order set.
host_type * host() const
The poset this is a member of.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, bool xauto_access)
Creates a new host table for members of this type. The poset is created in namespace xns with path xh...
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
A member of a sec_rep_space; a section.
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
virtual bool host_is_ancestor_of(const poset_state_handle *other) const
True if other conforms to host.
A Cartesian product space.
Abstract base class with useful features for all objects.
scalar_type * comp(int i) const
The ith component of section.
virtual section_space_schema_member & schema()
The schema for this poset (mutable version)
bool fiber_is_ancestor_of(const any *xother) const
static const std::string & static_class_name()
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)
An index within the external ("client") scope of a given id space.
bool invariant() const
Class invariant.
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
void set_comp(int i, scalar_type *component)
Sets ith comp of section.
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. ...
bool le(pod_index_type xother_index) const
True if this is less than or equal to the member with index xother_index.
virtual void restrict_to_same(const abstract_poset_member *xother)
Restricts this handle and its components to the same restriction as xother.
A member of a Cartesian product space; a tuple of attributes (persistent version).
bool empty() const
True if both poset name and member name are empty.
static const poset_path & standard_rep_path()
The path to the standard rep for sections of this type.
void detach_from_state()
Detaches field from state it is currently attached to.
int factor_ct() const
The number of factors in this product.
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
virtual int factor_ct() const
Number of factors (components) in tuple.
int_type pod_index_type
The plain old data index type.
poset & fiber_space()
The fiber space for section spaces on this schema (mutable version).
An abstract client handle for a member of a poset.
sec_tuple()
Default constructor.
Namespace for the fiber_bundles component of the sheaf system.
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 void restrict_to(const abstract_poset_member *xschema)
Restricts this section and its components to schema member xschema.
void attach_handle_data_members()
Initializes data members introduced by this handle.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
A handle for a poset whose members are numerical representations of sections of a fiber bundle...