25 #include "SheafSystem/${derived}.h" 27 #include "SheafSystem/assert_contract.h" 28 #include "SheafSystem/base_space_member.h" 29 #include "SheafSystem/${coords_invertible}.h" 30 #include "SheafSystem/${property}.h" 51 ensure(!is_attached());
60 ${derived}(
const ${derived}& xother,
bool xauto_access)
65 require(xauto_access || !xother.is_attached() || \
66 xother.state_is_read_accessible());
70 _coordinates->attach_to_state(xother._coordinates, xauto_access);
71 _property->attach_to_state(xother._property, xauto_access);
72 _base_space->attach_to_state(xother._base_space, xauto_access);
77 ensure(coordinates().is_same_state(&xother.coordinates()));
78 ensure(property().is_same_state(&xother.property()));
79 ensure(base_space().is_same_state(&xother.base_space()));
88 ${derived}(
const ${coords}& xcoordinates,
const ${
property}& xproperty,
bool xauto_access)
93 require(xcoordinates.is_attached());
94 require(xproperty.is_attached());
95 require(xauto_access || xcoordinates.state_is_read_accessible());
96 require(xauto_access || xproperty.state_is_read_accessible());
102 xcoordinates.get_read_access();
103 xproperty.get_read_access();
106 _coordinates->attach_to_state(&xcoordinates);
107 _property->attach_to_state(&xproperty);
108 _base_space->attach_to_state(&(xproperty.schema().base_space()));
112 xcoordinates.release_access();
113 xproperty.release_access();
119 ensure(coordinates().is_same_state(&xcoordinates));
120 ensure(property().is_same_state(&xproperty));
137 require(xauto_access || xns.state_is_read_accessible());
138 require(xns.contains_poset_member(xcoordinates_path));
139 require(xauto_access ||
140 xns.member_poset(xcoordinates_path).state_is_read_accessible());
141 require(xns.contains_poset_member(xproperty_path));
142 require(xauto_access ||
143 xns.member_poset(xproperty_path).state_is_read_accessible());
149 xns.get_read_access();
152 _coordinates->attach_to_state(&xns, xcoordinates_path, xauto_access);
153 _property->attach_to_state(&xns, xproperty_path, xauto_access);
157 _coordinates->get_read_access();
158 _property->get_read_access();
161 _base_space->attach_to_state(&(_property->schema().base_space()));
165 xns.release_access();
166 _coordinates->release_access();
167 _property->release_access();
173 ensure(coordinates().path(
true) == xcoordinates_path);
174 ensure(property().path(
true) == xproperty_path);
183 ${derived}(${
property}* xproperty,
184 ${coords_invertible}* xcoordinates,
186 : ${base}(xproperty, xcoordinates, xbase_space)
201 operator=(
const ${abs_base}& xother)
205 require(precondition_of(${abs_base}::operator=(xother)));
209 ${abs_base}::operator=(xother);
213 ensure(postcondition_of(${abs_base}::operator=(xother)));
223 operator=(
const ${derived}& xother)
227 require(precondition_of(${abs_base}::operator=(xother)));
231 ${abs_base}::operator=(xother);
235 ensure(postcondition_of(${abs_base}::operator=(xother)));
245 operator=(
const ${
property}& xsection)
249 require(precondition_of(${abs_base}::operator=(xsection)));
253 ${abs_base}::operator=(xsection);
257 ensure(postcondition_of(${abs_base}::operator=(xsection)));
268 operator=(
const ${fiber}& xfiber)
272 require(precondition_of(${abs_base}::operator=(xfiber)));
276 ${abs_base}::operator=(xfiber);
280 ensure(postcondition_of(${abs_base}::operator=(xfiber)));
291 operator=(
const ${volatile_fiber}& xfiber)
295 require(precondition_of(${abs_base}::operator=(xfiber)));
299 ${abs_base}::operator=(xfiber);
303 ensure(postcondition_of(${abs_base}::operator=(xfiber)));
335 ${
property}& result =
dynamic_cast<${property}&
>(*_property);
348 same_property_fiber_schema(
const ${derived}& xother,
bool xauto_access)
const 354 require(xauto_access || state_is_read_accessible());
361 xother.get_read_access();
364 result = property().schema().fiber_schema().
365 is_same_state(&xother.property().schema().fiber_schema());
370 xother.release_access();
393 const string& result = static_class_name();
397 ensure(!result.empty());
413 static const string result(
"${derived}");
417 ensure(!result.empty());
427 is_ancestor_of(
const any* xother)
const 432 require(xother != 0);
438 bool result =
dynamic_cast<const ${derived}*
>(xother) != 0;
456 result =
new ${derived}();
461 ensure(is_same_type(result));
475 if(invariant_check())
479 disable_invariant_check();
483 invariance(${base}::invariant());
487 invariance(state_is_read_accessible() ?
488 base_space().is_same_state(&property().schema().base_space()) :
491 invariance(state_is_read_accessible() ?
492 property().schema().base_space().le(&coordinates().
493 schema().base_space()) :
498 enable_invariant_check();
513 operator>>(
const ${derived}& xsrc, ${derived}& xdst)
517 require(xsrc.is_attached());
518 require(xdst.is_attached());
519 require(xsrc.same_property_fiber_schema(xdst,
true));
535 operator<<(std::ostream& xos,
const ${derived}& xfield)
539 require(xfield.state_is_read_accessible());
543 xfield.print_property_dofs(xos, 0,
"",
false,
false);
Namespace for fields component of sheaf system.
The default name space; a poset which contains other posets as members.
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
SHEAF_DLL_SPEC field_at0 & operator>>(const field_at0 &xsrc, field_at0 &xdst)
Pushes xsrc.property() to xdst.property().
A client handle for a member of a base space poset.
Abstract base class with useful features for all objects.
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &xos, const field_at0 &xfield)
Inserts field_at0 xfield into ostream xos.
Namespace for the fiber_bundles component of the sheaf system.