SheafSystem  0.0.0.0
st4_e2.cc
Go to the documentation of this file.
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
20 
21 #include "SheafSystem/st4_e2.impl.h"
22 
23 #include "SheafSystem/abstract_poset_member.impl.h"
24 #include "SheafSystem/assert_contract.h"
25 #include "SheafSystem/at0.h"
26 #include "SheafSystem/at1_space.h"
27 #include "SheafSystem/stp_space.h"
28 #include "SheafSystem/fiber_bundles_namespace.h"
29 #include "SheafSystem/schema_poset_member.h"
30 #include "SheafSystem/wsv_block.h"
31 
32 using namespace std;
33 using namespace fiber_bundle; // Workaround for MS C++ bug.
34 
35 
36 //==============================================================================
37 // CLASS ST4_E2_LITE
38 //==============================================================================
39 
40 //==============================================================================
41 // ST4_E2 FACET
42 //==============================================================================
43 
44 // PUBLIC MEMBER FUNCTIONS
45 
48 {
49 
50  // Preconditions:
51 
52  // Body:
53 
54  // Postconditions:
55 
56  ensure(invariant());
57 
58  // Exit:
59 }
60 
62 st4_e2_lite(const st4_e2_lite& xother)
63 {
64  // Preconditions:
65 
66  // Body:
67 
68  *this = xother;
69 
70  // Postconditions:
71 
72  ensure(invariant());
73 
74  // Exit:
75 }
76 
79 operator=(const st4_e2_lite& xother)
80 {
81 
82  // Preconditions:
83 
84  // Body:
85 
86  if(this == &xother)
87  return *this;
88 
89  _row_dofs = xother._row_dofs;
90 
91  // Postconditions:
92 
93  ensure(invariant());
94 
95  // Exit:
96 
97  return *this;
98 }
99 
102 {
103  // Preconditions:
104 
105  // Body:
106 
107  // Postconditions:
108 
109  // Exit:
110 }
111 
113 st4_e2_lite(const row_dofs_type& xrow_dofs)
114 {
115  // Preconditions:
116 
117  // Body:
118 
119  *this = xrow_dofs;
120 
121  // Postconditions:
122 
123  ensure(invariant());
124 
125  // Exit:
126 }
127 
130 operator=(const row_dofs_type& xrow_dofs)
131 {
132  // Preconditions:
133 
134  // Body:
135 
136  _row_dofs = xrow_dofs;
137 
138  // Postconditions:
139 
140  ensure(invariant());
141 
142  // Exit:
143 
144  return *this;
145 
146 }
147 
148 fiber_bundle::st4_e2_lite::
150 {
151  // Preconditions:
152 
153  // Body:
154 
155  row_dofs_type& result = _row_dofs;
156 
157  // Postconditions:
158 
159  // Exit:
160 
161  return result;
162 }
163 
164 fiber_bundle::st4_e2_lite::
165 operator const st4_e2_lite::row_dofs_type& () const
166 {
167  // Preconditions:
168 
169  // Body:
170 
171  const row_dofs_type& result = _row_dofs;
172 
173  // Postconditions:
174 
175  // Exit:
176 
177  return result;
178 }
179 
180 
181 // fiber_bundle::st4_e2_lite::
182 // st4_e2_lite(const value_type& xcomp)
183 // {
184 // // Preconditions:
185 
186 // // Body:
187 
188 // put_components(xcomp);
189 
190 // // Postconditions:
191 
192 // // Exit:
193 // }
194 
195 // void
196 // fiber_bundle::st4_e2_lite::
197 // put_components(const value_type& xcomp)
198 // {
199 // // Preconditions:
200 
201 // // Body:
202 
203 // put_component(0, xcomp);
204 
205 // // Postconditions:
206 
207 // ensure(invariant());
208 // ensure(isunordered_or_equals(component(0), xcomp));
209 
210 // // Exit:
211 // }
212 
213 // PROTECTED MEMBER FUNCTIONS
214 
215 // PRIVATE MEMBER FUNCTIONS
216 
217 
218 //==============================================================================
219 // ST4 FACET
220 //==============================================================================
221 
222 // PUBLIC MEMBER FUNCTIONS
223 
224 // PROTECTED MEMBER FUNCTIONS
225 
226 // PRIVATE MEMBER FUNCTIONS
227 
228 
229 //==============================================================================
230 // STP FACET
231 //==============================================================================
232 
233 // PUBLIC MEMBER FUNCTIONS
234 
235 // PROTECTED MEMBER FUNCTIONS
236 
237 // PRIVATE MEMBER FUNCTIONS
238 
239 
240 //==============================================================================
241 // TP FACET
242 //==============================================================================
243 
244 // PUBLIC MEMBER FUNCTIONS
245 
246 int
248 dd() const
249 {
250  // Preconditions:
251 
252  // Body:
253 
254  int result = 2;
255 
256  // Postconditions:
257 
258  ensure(invariant());
259  ensure(result == 2);
260 
261  // Exit:
262 
263  return result;
264 }
265 
266 // PROTECTED MEMBER FUNCTIONS
267 
268 // PRIVATE MEMBER FUNCTIONS
269 
270 
271 //==============================================================================
272 // VD FACET
273 //==============================================================================
274 
275 // PUBLIC MEMBER FUNCTIONS
276 
279 tp_prototype(int xp) const
280 {
281  // Preconditions:
282 
283  require(precondition_of(e2_lite::static_tp_prototype(xp)));
284 
285  // Body:
286 
287  const tp_lite& result = e2_lite::static_tp_prototype(xp);
288 
289  // Postconditions:
290 
291  ensure(postcondition_of(e2_lite::static_tp_prototype(xp)));
292 
293  // Exit:
294 
295  return result;
296 }
297 
300 atp_prototype(int xp) const
301 {
302  // Preconditions:
303 
304  require(precondition_of(e2_lite::static_atp_prototype(xp)));
305 
306  // Body:
307 
308  const atp_lite& result = e2_lite::static_atp_prototype(xp);
309 
310  // Postconditions:
311 
312  ensure(postcondition_of(e2_lite::static_atp_prototype(xp)));
313 
314  // Exit:
315 
316  return result;
317 }
318 
321 stp_prototype(int xp) const
322 {
323  // Preconditions:
324 
325  require(precondition_of(e2_lite::static_stp_prototype(xp)));
326 
327  // Body:
328 
329  const stp_lite& result = e2_lite::static_stp_prototype(xp);
330 
331  // Postconditions:
332 
333  ensure(postcondition_of(e2_lite::static_stp_prototype(xp)));
334 
335  // Exit:
336 
337  return result;
338 }
339 
340 // PROTECTED MEMBER FUNCTIONS
341 
342 // PRIVATE MEMBER FUNCTIONS
343 
344 
345 //==============================================================================
346 // TUPLE FACET
347 //==============================================================================
348 
349 // PUBLIC MEMBER FUNCTIONS
350 
351 // PROTECTED MEMBER FUNCTIONS
352 
353 // PRIVATE MEMBER FUNCTIONS
354 
355 
356 //==============================================================================
357 // ABSTRACT POSET MEMBER FACET
358 //==============================================================================
359 
360 // PUBLIC MEMBER FUNCTIONS
361 
362 const std::string&
364 class_name() const
365 {
366  // Preconditions:
367 
368  // Body:
369 
370  const string& result = static_class_name();
371 
372  // Postconditions:
373 
374  ensure(!result.empty());
375 
376  // Exit:
377 
378  return result;
379 }
380 
381 const std::string&
384 {
385  // Preconditions:
386 
387  // Body:
388 
389  static const string result("st4_e2_lite");
390 
391  // Postconditions:
392 
393  ensure(!result.empty());
394 
395  // Exit:
396 
397  return result;
398 }
399 
402 clone() const
403 {
404  st4_e2_lite* result = 0;
405 
406  // Preconditions:
407 
408  // Body:
409 
410  result = new st4_e2_lite();
411 
412  // Postconditions:
413 
414  ensure(result != 0);
415  ensure(is_same_type(*result));
416 
417  // Exit:
418 
419  return result;
420 }
421 
422 // PROTECTED MEMBER FUNCTIONS
423 
424 // PRIVATE MEMBER FUNCTIONS
425 
426 
427 //==============================================================================
428 // ANY FACET
429 //==============================================================================
430 
431 // PUBLIC MEMBER FUNCTIONS
432 
433 bool
435 is_ancestor_of(const any_lite& xother) const
436 {
437  // Preconditions:
438 
439  require(&xother != 0);
440 
441  // Body:
442 
443  // True if other conforms to this.
444 
445  bool result = dynamic_cast<const st4_e2_lite*>(&xother) != 0;
446 
447  // Postconditions:
448 
449  return result;
450 }
451 
452 bool
454 invariant() const
455 {
456  bool result = true;
457 
458  if(invariant_check())
459  {
460  // Prevent recursive calls to invariant.
461 
462  disable_invariant_check();
463 
464  // Must satisfy base class invariant.
465 
466  invariance(st4_lite::invariant());
467 
468  // Invariances for this class:
469 
470  // Finished, turn invariant checking back on.
471 
472  enable_invariant_check();
473  }
474 
475  // Exit
476 
477  return result;
478 }
479 
480 void*
483 {
484  return &_row_dofs;
485 }
486 
487 const void*
489 row_dofs() const
490 {
491  return &_row_dofs;
492 }
493 
494 // PROTECTED MEMBER FUNCTIONS
495 
496 // PRIVATE MEMBER FUNCTIONS
497 
498 
499 //==============================================================================
500 // CLASS ST4_E2
501 //==============================================================================
502 
503 // ===========================================================
504 // HOST FACTORY FACET OF CLASS ST4_E2
505 // ===========================================================
506 
507 // PUBLIC MEMBER FUNCTIONS
508 
509 const sheaf::poset_path&
512 {
513  // Preconditions:
514 
515 
516  // Body:
517 
518  static const poset_path result(standard_schema_poset_name(), "st4_e2_schema");
519 
520  // Postconditions:
521 
522  // Exit:
523 
524  return result;
525 }
526 
527 void
530 {
531  // Preconditions:
532 
533  require(xns.state_is_read_write_accessible());
534  require(xns.contains_poset(standard_schema_poset_name()));
535  require(!xns.contains_poset_member(standard_schema_path()));
536 
537 
538  // Body:
539 
540  string lmember_names = "xxxx DOUBLE false ";
541  lmember_names += "xxxy DOUBLE false ";
542  lmember_names += "xxyy DOUBLE false ";
543  lmember_names += "xyyy DOUBLE false ";
544  lmember_names += "yyyy DOUBLE false ";
545 
546  schema_poset_member lschema(xns,
547  standard_schema_path().member_name(),
548  st4::standard_schema_path(),
549  lmember_names,
550  false);
551 
552  lschema.detach_from_state();
553 
554  // Postconditions:
555 
556  ensure(xns.contains_poset_member(standard_schema_path()));
557 
558  // Exit:
559 
560  return;
561 }
562 
566  const poset_path& xhost_path,
567  const poset_path& xschema_path,
568  const poset_path& xvector_space_path,
569  bool xauto_access)
570 {
571  // cout << endl << "Entering st4_e2::new_host." << endl;
572 
573  // Preconditions:
574 
575  require(xns.state_is_auto_read_write_accessible(xauto_access));
576 
577  require(!xhost_path.empty());
578  require(!xns.contains_path(xhost_path, xauto_access));
579 
580  require(xschema_path.full());
581  require(xns.path_is_auto_read_accessible(xschema_path, xauto_access));
582  require(schema_poset_member::conforms_to(xns, xschema_path, standard_schema_path()));
583  require(schema_poset_member::row_dof_ct(xns, xschema_path, xauto_access) == 5);
584 
585  require(xns.path_is_auto_read_accessible(xvector_space_path, xauto_access));
586  require(xns.contains_poset<vector_space_type::host_type>(xvector_space_path, xauto_access));
587  require(xns.member_poset(xvector_space_path, xauto_access).schema(xauto_access).conforms_to(vector_space_type::standard_schema_path()));
588  require(xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).d(xauto_access) == 2);
589 
590  // Body:
591 
592  host_type& result =
593  host_type::new_table(xns, xhost_path, xschema_path, 4, xvector_space_path, xauto_access);
594 
595  // Postconditions:
596 
597  ensure(xns.owns(result, xauto_access));
598  ensure(result.path(true) == xhost_path);
599  ensure(result.state_is_not_read_accessible());
600  ensure(result.schema(true).path(xauto_access) == xschema_path);
601 
602  ensure(result.factor_ct(true) == 5);
603  ensure(result.d(true) == 5);
604  ensure(result.scalar_space_path(true) == xns.member_poset<vector_space_type::host_type>(xvector_space_path, xauto_access).scalar_space_path());
605  ensure(result.p(true) == 4);
606  ensure(result.dd(true) == 2);
607  ensure(result.vector_space_path(true) == xvector_space_path);
608 
609  // Exit:
610 
611  // cout << "Leaving st4_e2::new_host." << endl;
612  return result;
613 }
614 
617 standard_host(namespace_type& xns, const std::string& xsuffix, bool xauto_access)
618 {
619  // cout << endl << "Entering st4_e2::new_host." << endl;
620 
621  // Preconditions:
622 
623  require(xns.state_is_auto_read_write_accessible(xauto_access));
624 
625  require(xsuffix.empty() || poset_path::is_valid_name(xsuffix));
626  require(standard_host_is_available<st4_e2>(xns, xsuffix, xauto_access));
627 
628  require(xns.path_is_auto_read_accessible(standard_schema_path(), xauto_access));
629 
630  require(xns.path_is_auto_read_available(standard_host_path<vector_space_type>(xsuffix), xauto_access));
631 
632  // Body:
633 
634  // Create the vector space if necessary.
635 
636  poset_path lvector_space_path = vector_space_type::standard_host(xns, xsuffix, xauto_access).path(true);
637 
638  poset_path lpath(standard_host_path<st4_e2>(xsuffix));
639 
640  host_type* result_ptr;
641  if(xns.contains_path(lpath, xauto_access))
642  {
643  result_ptr = &xns.member_poset<host_type>(lpath, xauto_access);
644  }
645  else
646  {
647  result_ptr = &new_host(xns, lpath, standard_schema_path(), lvector_space_path, xauto_access);
648  }
649 
650  host_type& result = *result_ptr;
651 
652  // Postconditions:
653 
654  ensure(xns.owns(result, xauto_access));
655  ensure(result.path(true) == standard_host_path<st4_e2>(xsuffix));
656  ensure(result.state_is_not_read_accessible());
657  ensure(result.schema(true).path(xauto_access) == standard_schema_path());
658 
659  ensure(result.factor_ct(true) == 5);
660  ensure(result.d(true) == 5);
661  ensure(result.scalar_space_path(true) == standard_host_path<vector_space_type::scalar_type>(xsuffix) );
662  ensure(result.p(true) == 4);
663  ensure(result.dd(true) == 2);
664  ensure(result.vector_space_path(true) == standard_host_path<vector_space_type>(xsuffix) );
665 
666  // Exit:
667 
668  // cout << "Leaving st4_e2::new_host." << endl;
669  return result;
670 }
671 
672 // PROTECTED MEMBER FUNCTIONS
673 
674 // PRIVATE MEMBER FUNCTIONS
675 
676 
677 //==============================================================================
678 // ST4_E2 FACET
679 //==============================================================================
680 
681 // PUBLIC MEMBER FUNCTIONS
682 
685 {
686 
687  // Preconditions:
688 
689  // Body:
690 
691  // Postconditions:
692 
693  ensure(invariant());
694 }
695 
698 {
699  // Preconditions:
700 
701  require(xhost != 0);
702  require(xhost->state_is_read_accessible());
703  require(xhost->contains_member(xhub_id));
704 
705  // Body:
706 
707  attach_to_state(xhost, xhub_id);
708 
709  // Postconditions:
710 
711  ensure(invariant());
712  // ensure(host() == xhost);
713  ensure(index() == xhub_id);
714  ensure(is_attached());
715 }
716 
718 st4_e2(const poset_state_handle* xhost, const scoped_index& xid)
719 {
720  // Preconditions:
721 
722  require(xhost != 0);
723  require(xhost->state_is_read_accessible());
724  require(xhost->contains_member(xid));
725 
726  // Body:
727 
728  attach_to_state(xhost, xid.hub_pod());
729 
730  // Postconditions:
731 
732  ensure(invariant());
733  // ensure(host() == xhost);
734  ensure(index() ==~ xid);
735  ensure(is_attached());
736 }
737 
739 st4_e2(const poset_state_handle* xhost, const std::string& xname)
740 {
741 
742  // Preconditions:
743 
744  require(xhost != 0);
745  require(xhost->state_is_read_accessible());
746  require(!xname.empty());
747  require(xhost->contains_member(xname));
748 
749  // Body:
750 
751  attach_to_state(xhost, xname);
752 
753  // Postconditions:
754 
755  ensure(invariant());
756  // ensure(host() == xhost);
757  ensure(name() == xname);
758  ensure(is_attached());
759 
760 }
761 
764 {
765 
766  // Preconditions:
767 
768  require(xother != 0);
769 
770  // Body:
771 
772  attach_to_state(xother);
773 
774  // Postconditions:
775 
776  ensure(invariant());
777  ensure(is_attached());
778  ensure(is_same_state(xother));
779 
780 }
781 
783 st4_e2(poset_state_handle* xhost, bool xauto_access)
784 {
785 
786  // Preconditions:
787 
788  require(precondition_of(new_jim_state(xhost, 0, false, xauto_access)));
789 
790  // Body:
791 
792  new_jim_state(xhost, 0, false, xauto_access);
793 
794  // Postconditions:
795 
796  ensure(postcondition_of(new_jim_state(xhost, 0, false, xauto_access)));
797 
798  // Exit:
799 
800  return;
801 }
802 
805  const row_dofs_type& xrdt,
806  bool xauto_access)
807 {
808 
809  // Preconditions:
810 
811  require(precondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
812 
813  // Body:
814 
815  new_jim_state(&xhost, 0, false, xauto_access);
816 
817  if(xauto_access)
818  {
819  xhost.get_read_write_access();
820  }
821 
822  *this = xrdt;
823 
824  if(xauto_access)
825  {
826  xhost.release_access();
827  }
828 
829  // Postconditions:
830 
831  ensure(postcondition_of(new_jim_state(&xhost, 0, false, xauto_access)));
832 
833  // Exit:
834 
835  return;
836 }
837 
838 
842 {
843  // Preconditions:
844 
845  require(state_is_read_write_accessible());
846 
847  // Body:
848 
849  sheaf::row_dofs(*this) = xrdt;
850 
851  // Postconditions:
852 
853  ensure_for_all(i, 0, d(), component(i) == xrdt.components[i]);
854 
855  // Exit:
856 
857  return *this;
858 
859 }
860 
865 {
866  // Preconditions:
867 
868  require(is_ancestor_of(&xother));
869  require(precondition_of(attach_to_state(&xother)));
870 
871  // Body:
872 
873  attach_to_state(&xother);
874 
875  // Postconditions:
876 
877  ensure(postcondition_of(attach_to_state(&xother)));
878 
879  // Exit:
880 
881  return *this;
882 }
883 
887 operator=(const st4_e2& xother)
888 {
889  // Preconditions:
890 
891  require(precondition_of(attach_to_state(&xother)));
892 
893  // Body:
894 
895  attach_to_state(&xother);
896 
897  // Postconditions:
898 
899  ensure(postcondition_of(attach_to_state(&xother)));
900 
901  // Exit:
902 
903  return *this;
904 }
905 
908 {
909 
910  // Preconditions:
911 
912  // Body:
913 
914  // Postconditions:
915 
916 }
917 
921 {
922  // Preconditions:
923 
924  // Body:
925 
926  static const volatile_type result;
927 
928  // Postconditions:
929 
930  // Exit:
931 
932  return result;
933 }
934 
938 lite_type() const
939 {
940  // Preconditions:
941 
942  // Body:
943 
944  volatile_type* result = new volatile_type(sheaf::row_dofs(*this));
945 
946  // Postconditions:
947 
948  // Exit:
949 
950  return result;
951 }
952 
953 void
956 {
957  // Preconditions:
958 
959  require(state_is_read_write_accessible());
960 
961  // Body:
962 
963  put_component(0, xcomp);
964 
965  // Postconditions:
966 
967  ensure(invariant());
968  ensure(isunordered_or_equals(component(0), xcomp));
969 
970  // Exit:
971 
972  return;
973 }
974 
975 fiber_bundle::st4_e2::
977 {
978  // Preconditions:
979 
980  // Body:
981 
982  row_dofs_type& result = sheaf::row_dofs(*this);
983 
984  // Postconditions:
985 
986  // Exit:
987 
988  return result;
989 }
990 
991 fiber_bundle::st4_e2::
992 operator const st4_e2::row_dofs_type& () const
993 {
994  // Preconditions:
995 
996  // Body:
997 
998  const row_dofs_type& result = sheaf::row_dofs(*this);
999 
1000  // Postconditions:
1001 
1002  // Exit:
1003 
1004  return result;
1005 }
1006 
1007 // PROTECTED MEMBER FUNCTIONS
1008 
1009 // PRIVATE MEMBER FUNCTIONS
1010 
1011 
1012 //==============================================================================
1013 // ST4 FACET
1014 //==============================================================================
1015 
1016 // PUBLIC MEMBER FUNCTIONS
1017 
1018 // PROTECTED MEMBER FUNCTIONS
1019 
1020 // PRIVATE MEMBER FUNCTIONS
1021 
1022 
1023 //==============================================================================
1024 // STP FACET
1025 //==============================================================================
1026 
1027 // PUBLIC MEMBER FUNCTIONS
1028 
1029 // PROTECTED MEMBER FUNCTIONS
1030 
1031 // PRIVATE MEMBER FUNCTIONS
1032 
1033 
1034 //==============================================================================
1035 // TP FACET
1036 //==============================================================================
1037 
1038 // PUBLIC MEMBER FUNCTIONS
1039 
1040 // PROTECTED MEMBER FUNCTIONS
1041 
1042 // PRIVATE MEMBER FUNCTIONS
1043 
1044 
1045 //==============================================================================
1046 // TUPLE FACET
1047 //==============================================================================
1048 
1049 // PUBLIC MEMBER FUNCTIONS
1050 
1053 new_tp(int xp, bool xauto_access) const
1054 {
1055  // Preconditions:
1056 
1057  require(precondition_of(e2::new_tp(vector_space(xauto_access), xp)));
1058 
1059  // Body:
1060 
1061  tp* result = e2::new_tp(vector_space(xauto_access), xp);
1062 
1063  // Postconditions:
1064 
1065  ensure(postcondition_of(e2::new_tp(vector_space(xauto_access), xp)));
1066 
1067  // Exit:
1068 
1069  return result;
1070 }
1071 
1074 new_atp(int xp, bool xauto_access) const
1075 {
1076  // Preconditions:
1077 
1078  require(precondition_of(e2::new_atp(vector_space(xauto_access), xp)));
1079 
1080  // Body:
1081 
1082  atp* result = e2::new_atp(vector_space(xauto_access), xp);
1083 
1084  // Postconditions:
1085 
1086  ensure(postcondition_of(e2::new_atp(vector_space(xauto_access), xp)));
1087 
1088  // Exit:
1089 
1090  return result;
1091 }
1092 
1095 new_stp(int xp, bool xauto_access) const
1096 {
1097  // Preconditions:
1098 
1099  require(precondition_of(e2::new_stp(vector_space(xauto_access), xp)));
1100 
1101  // Body:
1102 
1103  stp* result = e2::new_stp(vector_space(xauto_access), xp);
1104 
1105  // Postconditions:
1106 
1107  ensure(postcondition_of(e2::new_stp(vector_space(xauto_access), xp)));
1108 
1109  // Exit:
1110 
1111  return result;
1112 }
1113 
1114 // PROTECTED MEMBER FUNCTIONS
1115 
1116 // PRIVATE MEMBER FUNCTIONS
1117 
1118 
1119 //==============================================================================
1120 // ABSTRACT POSET MEMBER FACET
1121 //==============================================================================
1122 
1123 // PUBLIC MEMBER FUNCTIONS
1124 
1125 const std::string&
1127 class_name() const
1128 {
1129  // Preconditions:
1130 
1131  // Body:
1132 
1133  const string& result = static_class_name();
1134 
1135  // Postconditions:
1136 
1137  ensure(!result.empty());
1138 
1139  // Exit:
1140 
1141  return result;
1142 }
1143 
1144 const std::string&
1147 {
1148  // Preconditions:
1149 
1150  // Body:
1151 
1152  static const string result("st4_e2");
1153 
1154  // Postconditions:
1155 
1156  ensure(!result.empty());
1157 
1158  // Exit:
1159 
1160  return result;
1161 }
1162 
1165 clone() const
1166 {
1167 
1168  // Preconditions:
1169 
1170  // Body:
1171 
1172  // Create new handle of the current class.
1173 
1174  st4_e2* result = new st4_e2();
1175 
1176  // Postconditions:
1177 
1178  ensure(result != 0);
1179  ensure(result->invariant());
1180 
1181  // Exit:
1182 
1183  return result;
1184 
1185 }
1186 
1187 // PROTECTED MEMBER FUNCTIONS
1188 
1189 // PRIVATE MEMBER FUNCTIONS
1190 
1191 
1192 //==============================================================================
1193 // ANY FACET
1194 //==============================================================================
1195 
1196 bool
1198 is_ancestor_of(const any* xother) const
1199 {
1200 
1201  // Preconditions:
1202 
1203  require(xother != 0);
1204 
1205  // Body:
1206 
1207  bool result = dynamic_cast<const st4_e2*>(xother) != 0;
1208 
1209  // Postconditions:
1210 
1211  // Exit:
1212 
1213  return result;
1214 
1215 }
1216 
1217 
1218 bool
1220 invariant() const
1221 {
1222  bool result = true;
1223 
1224  // Body:
1225 
1226  if(invariant_check())
1227  {
1228  // Prevent recursive calls to invariant.
1229 
1230  disable_invariant_check();
1231 
1232  // Must satisfy base class invariant.
1233 
1234  invariance(st4::invariant());
1235 
1236  // Invariances for this class:
1237 
1238  invariance((state_is_read_accessible() ? dd() == 2 : true));
1239 
1240  // Finished, turn invariant checking back on.
1241 
1242  enable_invariant_check();
1243  }
1244 
1245  // Exit:
1246 
1247  return result;
1248 }
1249 
1250 // PROTECTED MEMBER FUNCTIONS
1251 
1252 // PRIVATE MEMBER FUNCTIONS
1253 
1254 
1255 //==============================================================================
1256 // NON-MEMBER FUNCTIONS
1257 //==============================================================================
1258 
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 const std::string & class_name() const
The name of this class.
Definition: st4_e2.cc:364
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 atp * new_atp(int xp, bool xauto_access) const
Virtual constructor for antisymmetric tensors of degree xp over vector space xvector_space.
Definition: st4_e2.cc:1074
A symmetric tensor of degree p over an abstract vector space.
Definition: stp.h:190
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
An antisymmetric tensor of degree p.
Definition: atp.h:190
virtual const stp_lite & stp_prototype(int xp) const
Prototype for symmetric tensors of degree xp over this vector space.
Definition: st4_e2.cc:321
static int d(const namespace_poset &xns, int xp, const poset_path &xvector_space_path, bool xauto_access)
The tensor dimension implied by tensor degree xp and the dimension of the domain vector space specifi...
Definition: atp_space.cc:86
bool invariant() const
Class invariant.
Definition: st4_e2.cc:1220
virtual const std::string & class_name() const
The name of this class.
Definition: st4_e2.cc:1127
poset_path path(bool xauto_access=true) const
A path to this component.
virtual void put_components(dof_type xcomp)
Sets the value of the component to xcomp.
Definition: st4_e2.cc:955
bool conforms_to(const schema_poset_member &xother) const
True if the dofs defined by this agree in type and in order with the dofs defined by xother...
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...
poset_path vector_space_path() const
The path of the underlying vector space.
Definition: tp_space.cc:365
st4_e2()
Default constructor.
Definition: st4_e2.cc:684
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...
A client handle for a general, abstract partially order set.
st4_e2 & operator=(const row_dofs_type &xrdt)
Assignment to an instance of the associated row dofs type.
Definition: st4_e2.cc:841
A path defined by a poset name and a member name separated by a forward slash (&#39;/&#39;). For example: "cell_definitions/triangle".
Definition: poset_path.h:48
STL namespace.
bool invariant() const
Class invariant.
Definition: st4_e2.cc:454
virtual void * row_dofs()
The row dofs for this instance (mutable version).
Definition: st4_e2.cc:482
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 st4_e2_lite * clone() const
Virtual constructor, makes a new instance of the same type as this.
Definition: st4_e2.cc:402
static const std::string & static_class_name()
The name of this class.
Definition: st4_e2.cc:383
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
An antisymmetric tensor of degree p over an abstract vector space (volatile version).
Definition: atp.h:44
static int d(const namespace_poset &xns, int xp, const poset_path &xvector_space_path, bool xauto_access)
The tensor dimension implied by tensor degree xp and the dimension of the domain vector space specifi...
Definition: stp_space.cc:86
row_dofs_type _row_dofs
Row_dofs_type.
Definition: st4_e2.h:200
A general tensor of "degree" p and given "variance" over an abstract vector space.
Definition: tp.h:253
Abstract base class with useful features for all volatile objects.
Definition: any_lite.h:48
Abstract base class with useful features for all objects.
Definition: any.h:39
st4_e2_lite()
Default constructor.
Definition: st4_e2.cc:47
virtual st4_e2 * clone() const
Make a new handle, no state instance of current.
Definition: st4_e2.cc:1165
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
virtual int dd() const
Dimension of the underlying vector space.
Definition: st4_e2.cc:248
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...
virtual const atp_lite & atp_prototype(int xp) const
Prototype for antisymmetric tensors of degree xp over this vector space.
Definition: st4_e2.cc:300
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)
static host_type & standard_host(namespace_type &xns, const std::string &xsuffix, bool xauto_access)
The host with path standard_host_path<st4_e2>(xsuffix). Returns the host if it already exists...
Definition: st4_e2.cc:617
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.
Definition: scoped_index.h:116
static const std::string & static_class_name()
The name of this class.
Definition: st4_e2.cc:1146
virtual ~st4_e2_lite()
Destructor.
Definition: st4_e2.cc:101
bool is_ancestor_of(const any *xother) const
True if xother conforms to current.
Definition: st4_e2.cc:1198
static void make_standard_schema(namespace_poset &xns)
Creates the standard schema for this class in namespace xns.
Definition: st4_e2.cc:529
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 host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xvector_space_path, bool xauto_access)
Creates a new host table for members of this type. The poset is created in namespace xns with path xh...
Definition: st4_e2.cc:565
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. ...
int p(int xd, int xdd) const
Tensor degree as a function of tensor dimension xd and domain dimension xdd.
Definition: tp_space.cc:235
virtual bool is_ancestor_of(const any_lite &xother) const
Conformance test; true if other conforms to this.
Definition: st4_e2.cc:435
A symmetric rank 3 tensor over a 3D Euclidean vector space (persistent version).
Definition: st4_e2.h:376
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
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...
virtual tp * new_tp(int xp, bool xauto_access) const
Virtual constructor for general tensors of degree xp over vector space xvector_space.
Definition: st4_e2.cc:1053
~st4_e2()
Destructor.
Definition: st4_e2.cc:907
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
A symmetric rank 4 tensor over a Euclidean vector space of dimension 3. (volatile version)...
Definition: st4_e2.h:124
bool path_is_auto_read_available(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath does not exist or exists and is auto read accessible.
poset_path scalar_space_path() const
The path of the underlying space of scalars.
Definition: vd_space.cc:250
An abstract vector space viewed as an antisymmetric tensor space of degree 1.
Definition: at1_space.h:42
virtual const volatile_type & lite_prototype() const
Virtual constructor for the associated volatile type.
Definition: st4_e2.cc:920
virtual const tp_lite & tp_prototype(int xp) const
Prototype for general tensors of degree xp over this vector space.
Definition: st4_e2.cc:279
static int factor_ct(int xd)
Factor_ct() as a function of dimension xd.
Definition: vd_space.cc:167
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
Definition: st4_e2.cc:511
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
T components[5]
The components in the order:
Definition: st4_e2.h:106
int dd() const
The dimension of the underlying ("domain") vector space.
Definition: tp_space.cc:317
virtual stp * new_stp(int xp, bool xauto_access) const
Virtual constructor for symmetric tensors of degree xp over vector space xvector_space.
Definition: st4_e2.cc:1095
st4_e2_lite & operator=(const st4_e2_lite &xother)
Assignment operator.
Definition: st4_e2.cc:79
An abstract client handle for a member of a poset.
std::string path() const
The full path as a string.
Definition: poset_path.cc:450
vd_dof_type dof_type
The type of the degrees of freedom. Note that although dof_type == value_type in this implementation...
Definition: vd.h:431
A symmetric tensor of degree p over an abstract vector space (volatile version).
Definition: stp.h:44
An abstract symmetric tensor space of degree p.
Definition: stp_space.h:42
Namespace for the fiber_bundles component of the sheaf system.
virtual volatile_type * lite_type() const
Virtual conversion to the associated volatile type.
Definition: st4_e2.cc:938
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.
A symmetric rank 4 tensor over an abstract vector space. (volatile version).
Definition: st4.h:43
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710
SHEAF_DLL_SPEC bool isunordered_or_equals(float x1, float x2)
True if isunordered(x1, x2) or x1 == x2.
Definition: sheaf.cc:102