SheafSystem  0.0.0.0
binary_section_space_schema_member.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/binary_section_space_schema_member.impl.h"
22 
23 #include "SheafSystem/binary_section_space_schema_poset.h"
24 #include "SheafSystem/assert_contract.h"
25 #include "SheafSystem/base_space_poset.h"
26 #include "SheafSystem/fiber_bundles_namespace.h"
27 #include "SheafSystem/sec_rep_descriptor.h"
28 #include "SheafSystem/sec_rep_descriptor_poset.h"
29 #include "SheafSystem/wsv_block.h"
30 
31 using namespace std;
32 using namespace fiber_bundle; // Workaround for MS C++ bug.
33 
34 // ===========================================================
35 // HOST FACTORY FACET
36 // ===========================================================
37 
38 // PUBLIC MEMBER FUNCTIONS
39 
40 const sheaf::poset_path&
43 {
44  // Preconditions:
45 
46  // Body:
47 
48  static const poset_path
49  result(section_space_schema_member::standard_schema_path().poset_name(), "binary_section_space_schema_schema");
50 
51  // Postconditions:
52 
53  ensure(result.full());
54 
55  // Exit:
56 
57  return result;
58 }
59 
60 void
63 {
64  // Preconditions:
65 
66  require(xns.state_is_read_write_accessible());
67  require(xns.contains_poset(standard_schema_path(), false));
68  require(xns.member_poset(standard_schema_path(), false).state_is_read_write_accessible());
69  require(!xns.contains_poset_member(standard_schema_path(), false));
70 
71  // Body:
72 
73  // This class doesn't add any dofs.
74 
75  schema_poset_member lschema(xns,
76  standard_schema_path().member_name(),
77  section_space_schema_member::standard_schema_path(),
78  "",
79  false);
80 
81  lschema.detach_from_state();
82 
83  // Postconditions:
84 
85  ensure(xns.contains_poset_member(standard_schema_path()));
86 
87  // Exit
88 
89  return;
90 }
91 
95  const poset_path& xhost_path,
96  const poset_path& xschema_path,
97  const poset_path& xbase_path,
98  const poset_path& xfiber_path,
99  const poset_path& xrep_path,
100  bool xauto_access)
101 {
102  // cout << endl << "Entering binary_section_space_schema_member::new_host." << endl;
103 
104  // Preconditions:
105 
106  require(xns.state_is_auto_read_write_accessible(xauto_access));
107 
108  require(!xhost_path.empty());
109  require(!xns.contains_path(xhost_path, xauto_access));
110 
111  require(xschema_path.full());
112  require(xns.path_is_auto_read_accessible(xschema_path, xauto_access));
113  require(schema_poset_member::conforms_to(xns, xschema_path, host_type::standard_schema_path(), xauto_access));
114 
115  require(xbase_path.full());
116  require(xns.path_is_auto_read_accessible<base_space_poset>(xbase_path, xauto_access));
117 
118  require(!xfiber_path.empty());
119  require(xns.path_is_auto_read_accessible(xfiber_path, xauto_access));
120 
121  require(xrep_path.full());
122  require(xns.path_is_auto_read_accessible<sec_rep_descriptor_poset>(xrep_path, xauto_access));
123 
124  // Body:
125 
126  host_type& result = host_type::new_table(xns, xhost_path, xschema_path, xbase_path, xfiber_path, xrep_path, xauto_access);
127 
128  // Postconditions:
129 
130  ensure(xns.owns(result, xauto_access));
131  ensure(result.path(true) == xhost_path);
132  ensure(result.state_is_not_read_accessible());
133  ensure(result.schema(true).path(xauto_access) == xschema_path);
134 
135  ensure(result.base_space_path(true).poset_name() == xbase_path.poset_name());
136  ensure(result.fiber_space_path(true) == xfiber_path);
137  ensure(result.rep_path(true) == xrep_path);
138 
139  // Exit:
140 
141  // cout << "Leaving binary_section_space_schema_member::new_host." << endl;
142  return result;
143 }
144 
145 // PROTECTED MEMBER FUNCTIONS
146 
147 // PRIVATE MEMBER FUNCTIONS
148 
149 
150 // ===========================================================
151 // BINARY_SECTION_SPACE_SCHEMA_MEMBER FACET
152 // ===========================================================
153 
154 // PUBLIC MEMBER FUNCTIONS
155 
159 {
160  // Preconditions:
161 
162  // Body:
163 
164  // Nothing to do; base class does it all.
165 
166  // Postconditions:
167 
168  ensure(invariant());
169  ensure(!is_attached());
170  ensure(!is_valid(base_space_id()));
171  ensure(!is_valid(fiber_schema_id()));
172  ensure(!base_space().is_attached());
173  ensure(!fiber_schema().is_attached());
174 
175  // Exit:
176 }
177 
180 {
181  // Preconditions:
182 
183  // Body:
184 
185  attach_to_state(&xother);
186 
187  // postconditions:
188 
189  ensure(invariant());
190  ensure(is_attached() == xother.is_attached() );
191 }
192 
196 {
197  // Preconditions:
198 
199  // Body:
200 
201  attach_to_state(&xother);
202 
203  // Postconditions:
204 
205  ensure(is_same_state(&xother));
206 
207  // Exit
208 
209  return *this;
210 }
211 
215 {
216 
217  // Preconditions:
218 
219  require(is_ancestor_of(&xother));
220 
221  //Body:
222 
223  not_implemented();
224 
225  //Postconditions:
226 
227  ensure(invariant());
228 
229  //Exit:
230 
231  return *this;
232 }
233 
236 {
237 
238  // Preconditions:
239 
240  // Body:
241 
242  // Nothing to do.
243 
244  // Postconditions:
245 
246  // Exit
247 
248  return;
249 }
250 
251 // NEW HANDLE, NEW STATE CONSTRUCTORS
252 
253 // NEW HANDLE, EXISTING STATE CONSTRUCTORS
254 
257  pod_index_type xhub_id)
258 {
259  // Preconditions:
260 
261  require(xhost->state_is_read_accessible());
262  require(xhost->contains_member(xhub_id));
263 
264  // Body:
265 
266  attach_to_state(xhost, xhub_id);
267 
268  // Postconditions:
269 
270  ensure(invariant());
271  ensure(host() == xhost);
272  ensure(index() == xhub_id);
273  ensure(is_attached());
274 }
275 
278  const scoped_index& xid)
279 {
280  // Preconditions:
281 
282  require(xhost->state_is_read_accessible());
283  require(xhost->contains_member(xid));
284 
285  // Body:
286 
287  attach_to_state(xhost, xid.hub_pod());
288 
289  // Postconditions:
290 
291  ensure(invariant());
292  ensure(host() == xhost);
293  ensure(index() ==~ xid);
294  ensure(is_attached());
295 }
296 
299  const std::string& xname)
300 {
301  // Preconditions:
302 
303  require(xhost != 0);
304  require(xhost->state_is_read_accessible());
305  require(!xname.empty());
306  require(xhost->contains_member(xname));
307 
308  // Body:
309 
310  attach_to_state(xhost, xname);
311 
312  // Postconditions:
313 
314  ensure(invariant());
315  ensure(host() == xhost);
316  ensure(name() == xname);
317  ensure(is_attached());
318 }
319 
320 
323  pod_index_type xbase_space_id,
324  pod_index_type xfiber_schema_id)
325 {
326  // Preconditions:
327 
328  require(precondition_of(attach_to_state(same args)));
329 
330  // Body:
331 
332  attach_to_state(xhost, xbase_space_id, xfiber_schema_id);
333 
334  // Postconditions:
335 
336  ensure(postcondition_of(attach_to_state(same args)));
337 
338  // Exit
339 
340  return;
341 }
342 
345  const scoped_index& xbase_space_id,
346  const scoped_index& xfiber_schema_id)
347 {
348  // Preconditions:
349 
350  require(precondition_of(attach_to_state(same args)));
351 
352  // Body:
353 
354  attach_to_state(xhost,
355  xbase_space_id.hub_pod(),
356  xfiber_schema_id.hub_pod());
357 
358  // Postconditions:
359 
360  ensure(postcondition_of(attach_to_state(same args)));
361 
362  // Exit
363 
364  return;
365 }
366 
369  const poset_path& xbase_path,
370  const poset_path& xfiber_schema_path)
371 {
372  // Preconditions:
373 
374  require(precondition_of(attach_to_state(same args)));
375 
376  // Body:
377 
378  attach_to_state(xhost, xbase_path, xfiber_schema_path);
379 
380  // Postconditions:
381 
382  ensure(postcondition_of(attach_to_state(same args)));
383 
384  // Exit
385 
386  return;
387 }
388 
391  const poset_path& xpath,
392  bool xauto_access)
393 {
394  // Preconditions:
395 
396  require(precondition_of(attach_to_state(same args)));
397 
398  // Body:
399 
400  attach_to_state(&xns, xpath, xauto_access);
401 
402  // Postconditions:
403 
404  ensure(postcondition_of(attach_to_state(same args)));
405 
406  // Exit:
407 
408  return;
409 }
410 
411 // PROTECTED MEMBER FUNCTIONS
412 
413 // PRIVATE MEMBER FUNCTIONS
414 
415 
416 // ===========================================================
417 // SECTION_SPACE_SCHEMA_MEMBER FACET
418 // ===========================================================
419 
420 // PUBLIC MEMBER FUNCTIONS
421 
425 {
427 
428  // Preconditions:
429 
430  require(state_is_read_accessible());
431 
432  // Body:
433 
434  result = new binary_section_component_iterator(*this);
435 
436  // Postconditions:
437 
438  ensure(result != 0);
439 
440  // Exit
441 
442  return result;
443 }
444 
445 // PROTECTED MEMBER FUNCTIONS
446 
447 // PRIVATE MEMBER FUNCTIONS
448 
449 
450 // ===========================================================
451 // SCHEMA_POSET_MEMBER FACET
452 // ===========================================================
453 
454 // PUBLIC MEMBER FUNCTIONS
455 
458 dof_tuple_type(bool xis_table_dof) const
459 {
460  primitive_type result = NOT_A_PRIMITIVE_TYPE;
461 
462  // Preconditions:
463 
464  require(state_is_read_accessible());
465 
466  // Body:
467 
468  result = fiber_schema().dof_tuple_type(xis_table_dof);
469 
470  // Postconditions:
471 
472  ensure(xis_table_dof ? result == NOT_A_PRIMITIVE_TYPE : true);
473 
474  // Exit
475 
476  return result;
477 }
478 
481 dof_descriptors(bool xis_table_dof) const
482 {
483  dof_descriptor_array* result = 0;
484 
485  // Preconditions:
486 
487  require(state_is_read_accessible());
488 
489  // Dof descriptors not defined for row dofs.
490 
491  require(xis_table_dof);
492 
493  // Body:
494 
495  result = fiber_schema().dof_descriptors(xis_table_dof);
496 
497  // Postconditions:
498 
499  ensure(unexecutable(result != 0 implies it points to a buffer of length table_dof_ct()+1));
500 
501  // Exit
502 
503  return result;
504 }
505 
506 bool
508 is_dof(bool xin_table_dofs) const
509 {
510  bool result;
511 
512  // Preconditions:
513 
514  require(state_is_read_accessible());
515 
516  // Body:
517 
518  if(xin_table_dofs)
519  {
520  // Table dofs:
521 
522  // Table dofs are {base.bottom()} x {fiber schema table dofs}.
523 
524  result = (_base_space_id == BOTTOM_INDEX) && fiber_schema().is_table_dof();
525  }
526  else
527  {
528  // Row dofs:
529 
531  }
532 
533  // Postconditions:
534 
535  // Exit
536 
537  return result;
538 }
539 
540 size_t
542 size() const
543 {
544  size_t result;
545 
546  // Preconditions:
547 
548  require(state_is_read_accessible());
549  require(fiber_schema().is_jim());
550 
551  // Body:
552 
553  result = fiber_schema().size();
554 
555  // Postconditions:
556 
557  // Exit
558 
559  return result;
560 }
561 
562 size_t
564 alignment() const
565 {
566  size_t result;
567 
568  // Preconditions:
569 
570  require(state_is_read_accessible());
571  require(fiber_schema().is_jim());
572 
573  // Body:
574 
575  result = fiber_schema().alignment();
576 
577  // Postconditions:
578 
579  // Exit
580 
581  return result;
582 }
583 
586 type() const
587 {
588  sheaf::primitive_type result;
589 
590  // Preconditions:
591 
592  require(state_is_read_accessible());
593  require(fiber_schema().is_jim());
594 
595  // Body:
596 
597  result = fiber_schema().type();
598 
599  // Postconditions:
600 
601  ensure(is_primitive_index(result));
602 
603  // Exit
604 
605  return result;
606 }
607 
610 dof_iterator(bool xis_table_dofs, int xversion) const
611 {
613 
614  // Preconditions:
615 
616  require(state_is_read_accessible());
617  require(has_version(xversion));
618 
619  // Body:
620 
621  result = new binary_section_dof_iterator(*this, xis_table_dofs, xversion);
622 
623  // Postconditions:
624 
625  ensure(result != 0);
626 
627  // Exit
628 
629  return result;
630 }
631 
632 // PROTECTED MEMBER FUNCTIONS
633 
634 void
636 update_row_cache(bool xupdate_id_map) const
637 {
638  // Preconditions:
639 
640  // Body:
641 
643 
645 
647 
649 
652 
653  // Postconditions:
654 
655  // Exit
656 
657  return;
658 }
659 
660 // PRIVATE MEMBER FUNCTIONS
661 
662 
663 // ===========================================================
664 // I/O SUPPORT FACET
665 // ===========================================================
666 
667 // PUBLIC MEMBER FUNCTIONS
668 
672 {
675 
676  // Preconditions:
677 
678  require(state_is_read_accessible());
679  require(host()->base_space().includes_subposet(xindex));
680 
681  // Body:
682 
683  zn_to_bool* ldecomp = new zn_to_bool();
684 
685  subposet ldecomp_sp(&host()->base_space(), xindex);
686 
687  index_iterator litr = ldecomp_sp.indexed_member_iterator();
688  while(!litr.is_done())
689  {
690  pod_index_type lschema_mbr_id =
692 
693  ldecomp->force(lschema_mbr_id, true);
694 
695  litr.next();
696  }
697 
698  ldecomp_sp.detach_from_state();
699 
700  index_iterator* result = new index_iterator(ldecomp,
701  host()->member_hub_id_space(false),
702  true);
703 
704  // Postconditions:
705 
706  // Exit:
707 
708  return result;
709 }
712 get_int_id(pod_index_type xext_id, const std::string& xid_space_name) const
713 {
714  // Preconditions:
715 
716  require(state_is_read_accessible());
717  require(precondition_of(host()->base_space().get_ext_id(index(), xid_space_name)));
718 
719  // Body:
720 
723 
724  pod_index_type lbase_id =
725  host()->base_space().get_int_id(xext_id, xid_space_name, false);
726 
727  pod_index_type result =
729 
730  // Postconditions:
731 
732  ensure(host()->contains_member(result));
733 
734  // Exit:
735 
736  return result;
737 }
738 
739 void
741 get_ext_ids(const std::string& xid_space_name,
742  pod_index_type& xschema_poset_ext_id,
743  pod_index_type& xschema_member_ext_id,
744  pod_index_type& xbase_space_ext_id,
745  pod_index_type& xfiber_schema_ext_id,
746  pod_index_type& xlocal_schema_ext_id) const
747 {
748  // Preconditions:
749 
750  require(state_is_read_accessible());
751  require(host()->member_id_spaces(false).contains(xid_space_name));
752  require(host()->base_space().member_id_spaces(false).contains(xid_space_name));
753  require(host()->base_space().member_id_spaces(false).contains_hub(xid_space_name, base_space_id()));
754  require(host()->fiber_schema().member_id_spaces(false).contains(xid_space_name));
755  require(host()->fiber_schema().member_id_spaces(false).contains_hub(xid_space_name, fiber_schema_id()));
756 
757  // Body:
758 
759  // Get the external id for the schema poset (this->host()).
760 
761  xschema_poset_ext_id =
762  name_space()->get_ext_id(host()->index(), xid_space_name, false);
763 
764  // Schema member external id is undefined.
765 
766  xschema_member_ext_id = invalid_pod_index();
767 
768  // Get the external id for the base space component.
769 
770  xbase_space_ext_id =
771  host()->base_space().get_ext_id(base_space_id(), xid_space_name, false);
772 
773  // Get the external id for the fiber schema component.
774 
775  xfiber_schema_ext_id =
776  host()->fiber_schema().get_ext_id(fiber_schema_id(), xid_space_name, false);
777 
778  // Local schema id is undefined.
779 
780  xlocal_schema_ext_id = invalid_pod_index();
781 
782  // Postconditions:
783 
784 
785  // Exit:
786 
787  return;
788 }
789 
793 {
794  return fiber_schema();
795 }
796 
797 size_t
799 ext_data_type_ct(bool xis_table_schema) const
800 {
801  // Preconditions:
802 
803  require(state_is_read_accessible());
804 
805  // Body:
806 
807  // For binary schema members,
808  // the external data type is the entire schema.
809 
810  size_t result = xis_table_schema ? 1 : discretization_ct();
811 
812  // Postconditions:
813 
814 
815  // Exit:
816 
817  return result;
818 }
819 
820 // PROTECTED MEMBER FUNCTIONS
821 
822 // PRIVATE MEMBER FUNCTIONS
823 
824 
825 // ===========================================================
826 // DEGREE OF FREEDOM (DOF) TUPLE FACET
827 // ===========================================================
828 
829 // PUBLIC MEMBER FUNCTIONS
830 
833 dof_map(bool xrequire_write_access)
834 {
835 
836  // Preconditions:
837 
838  require(xrequire_write_access ?
841  require(is_jim(false));
842 
843  // Body:
844 
845  primitives_poset_dof_map& result = fiber_schema().dof_map(xrequire_write_access);
846 
847  // Postconditions:
848 
849  // Exit:
850 
851  return result;
852 }
853 
856 dof_map(bool xrequire_write_access) const
857 {
858 
859  // Preconditions:
860 
861  require(xrequire_write_access ?
864  require(is_jim(false));
865 
866  // Body:
867 
868  const primitives_poset_dof_map& result = fiber_schema().dof_map(xrequire_write_access);
869 
870  // Postconditions:
871 
872  // Exit:
873 
874  return result;
875 }
876 
877 // PROTECTED MEMBER FUNCTIONS
878 
879 // PRIVATE MEMBER FUNCTIONS
880 
881 
882 // ===========================================================
883 // STATE FACET
884 // ===========================================================
885 
886 // PUBLIC MEMBER FUNCTIONS
887 
888 void
891  pod_index_type xfiber_schema_id)
892 {
893  // Preconditions:
894 
895  require(state_is_read_accessible());
896  require(host()->base_space().contains_member(xbase_space_id));
897  require(host()->fiber_schema().contains_member(xfiber_schema_id));
898 
899  // Body:
900 
901  _index = hub_id(host()->get_index_from_components(xbase_space_id, xfiber_schema_id));
902  _version = CURRENT_HOST_VERSION;
903 
905 
907 
908  // Postconditions:
909 
910  ensure(base_space_id() == xbase_space_id);
911  ensure(base_space().is_attached());
912  ensure(fiber_schema_id() == xfiber_schema_id);
913  ensure(fiber_schema().is_attached());
914 
915  // Exit
916 
917  return;
918 }
919 
920 void
923  pod_index_type xbase_space_id,
924  pod_index_type xfiber_schema_id)
925 {
926  // Preconditions:
927 
928  require(xhost != 0);
929  require(host_is_ancestor_of(xhost));
930  require(xhost->state_is_read_accessible());
931  require(xhost->base_space().contains_member(xbase_space_id));
932  require(xhost->fiber_schema().contains_member(xfiber_schema_id));
933 
934  // Body:
935 
936  _host = const_cast<section_space_schema_poset*>(xhost);
937  _index = hub_id(host()->get_index_from_components(xbase_space_id, xfiber_schema_id));
938  _version = CURRENT_HOST_VERSION;
939 
941 
943 
944  // Postconditions:
945 
946  ensure(base_space_id() == xbase_space_id);
947  ensure(base_space().is_attached());
948  ensure(fiber_schema_id() == xfiber_schema_id);
949  ensure(fiber_schema().is_attached());
950 
951  // Exit
952 
953  return;
954 }
955 
956 void
959  const poset_path& xbase_path,
960  const poset_path& xfiber_schema_path)
961 {
962  // Preconditions:
963 
964  require(xhost != 0);
965  require(host_is_ancestor_of(xhost));
966  require(xhost->state_is_read_accessible());
967  require(xbase_path.full());
968  require(xhost->base_space().contains_member(xbase_path.member_name()));
969  require(xfiber_schema_path.full());
970  require(xhost->fiber_schema().contains_member(xfiber_schema_path.member_name()));
971 
972  // Body:
973 
974  attach_to_state(xhost,
975  xhost->base_space().member_id(xbase_path.member_name(), false),
976  xhost->fiber_schema().member_id(xfiber_schema_path.member_name(), false));
977 
978  // Postconditions:
979 
980  ensure(is_attached());
981  ensure(base_space().has_path(xbase_path, false));
982  ensure(fiber_schema().has_path(xfiber_schema_path, false));
983 
984  // Exit
985 
986  return;
987 }
988 
989 // PROTECTED MEMBER FUNCTIONS
990 
991 // PRIVATE MEMBER FUNCTIONS
992 
993 
994 // ===========================================================
995 // HOST POSET FACET
996 // ===========================================================
997 
998 // PUBLIC MEMBER FUNCTIONS
999 
1000 bool
1003 {
1004  bool result;
1005 
1006  // Preconditions:
1007 
1008  // Body:
1009 
1010  result = dynamic_cast<const binary_section_space_schema_poset*>(xother) != 0;
1011 
1012  // Postconditions:
1013 
1014  // Exit
1015 
1016  return result;
1017 }
1018 
1019 // PROTECTED MEMBER FUNCTIONS
1020 
1021 // PRIVATE MEMBER FUNCTIONS
1022 
1023 
1024 // ===========================================================
1025 // ANY FACET
1026 // ===========================================================
1027 
1028 // PUBLIC MEMBER FUNCTIONS
1029 
1030 bool
1032 is_ancestor_of(const any* xother) const
1033 {
1034  bool result;
1035 
1036  // Preconditions:
1037 
1038  // Body:
1039 
1040  result = dynamic_cast<const binary_section_space_schema_member*>(xother) != 0;
1041 
1042  // Postconditions:
1043 
1044  // Exit
1045 
1046  return result;
1047 }
1048 
1051 clone() const
1052 {
1053 
1054  // Preconditions:
1055 
1056  // Body:
1057 
1058  // create new handle of the current class.
1059 
1062 
1063  // Postconditions:
1064 
1065  ensure(result != 0);
1066  ensure(result->invariant());
1067 
1068  // Exit:
1069 
1070  return result;
1071 }
1072 
1073 bool
1075 invariant() const
1076 {
1077  bool result = true;
1078 
1079  // Preconditions:
1080 
1081  // Body:
1082 
1083  // Must satisfy base class invariant
1084 
1085  result = result && schema_poset_member::invariant();
1086 
1087  if(invariant_check())
1088  {
1089  // Prevent recursive calls to invariant
1090 
1092 
1095 
1096  // Finished, turn invariant checking back on.
1097 
1099  }
1100 
1101  // Postconditions:
1102 
1103  // Exit
1104 
1105  return result;
1106 }
1107 
1108 // PROTECTED MEMBER FUNCTIONS
1109 
1110 // PRIVATE MEMBER FUNCTIONS
bool has_path(const poset_path &xpath, bool xauto_access) const
True if and only if xpath refers to this component.
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 bool is_jim(bool xin_current_version=true) const
True if this member is join irreducible in the current version of the host (xin_current_version == tr...
virtual void get_ext_ids(const std::string &xid_space_name, pod_index_type &xschema_poset_ext_id, pod_index_type &xschema_member_ext_id, pod_index_type &xbase_space_ext_id, pod_index_type &xfiber_schema_ext_id, pod_index_type &xlocal_schema_ext_id) const
Gets the external ids of this in the id space with namexid_space_name.
A client handle for a subposet.
Definition: subposet.h:86
Iterates in postorder over dofs of a schema member anchor. Attaches an a handle of type section_space...
A client handle for a poset member which has been prepared for use as a schema for a section space...
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
int version(bool xunalias=true) const
The (possibly aliased) version of this component. The version of the host used when evaluating proper...
void length(const S &x0, SR &xresult, bool xauto_access)
Definition: sec_ed.impl.h:181
binary_section_space_schema_poset * host() const
The poset which this is a handle to a component of.
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
Definition: scoped_index.h:672
virtual size_t size() const
The number of bytes in this dof.
virtual primitives_poset_dof_map & dof_map(bool xrequire_write_access=false)
The map from schema member ids or client ids to dof values for this poset member (mutable version) ...
virtual schema_poset_member & ext_data_type_schema()
The schema for the external data type associated with this schema.
schema_poset_member & fiber_schema()
The fiber schema component of this (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...
poset_state_handle * _host
The host poset for this component.
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.
virtual void update_row_cache(bool xupdate_id_space=false) const
Updates cached row properties.
const scoped_index & index() const
The current item in the subset.
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
dof_descriptor_array * dof_descriptors(bool xis_table_dof) const
The dof_descriptors_array for the table dof tuple (xis_table_dof true) or row dof tuple defined by th...
subposet & discretization()
The discretization subposet for section spaces on this schema.
virtual bool contains_member(pod_index_type xmbr_hub_id) const
True if this poset contains poset member with hub id xmbr_hub_id.
Definition: subposet.cc:955
STL namespace.
bool is_same_state(const poset_state_handle *xhost, pod_index_type xhub_id) const
True is this is attached to state with hub id xhub_id in host xhost.
A schema poset for a section space. A binary Cartesian product subspace of the binary tensor product ...
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 bool is_ancestor_of(const any *other) const
True if other conforms to this.
virtual namespace_poset * name_space() const
The namespace of host()
const scoped_index & index() const
The index of the component state this handle is attached to.
std::string name() const
A name for this.
The poset for sec_rep_descriptors.
virtual primitive_type type() const
The primitive type index of the dof defined by this.
poset_path rep_path(bool xauto_access) const
The path to the representation for section spaces on this schema..
virtual size_t ext_data_type_ct(bool xis_table_schema) const
The number of instances of the external data type needed to represent this schema.
virtual void attach_to_state(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id)
Attach to the state in host() with component ids xbase_id and xfiber_schema_id.
void next()
Makes item the next member of the subset.
virtual ~binary_section_space_schema_member()
Destructor; deletes a poset member and its attached state, if any.
Abstract base class with useful features for all objects.
Definition: any.h:39
scoped_index _index
The index for this component within the host.
pod_index_type fiber_schema_id() const
The member id of the fiber schema component of this.
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Z...
Definition: zn_to_bool.h:52
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
virtual size_t alignment() const
The alignment for this dof.
pod_index_type get_int_id(pod_index_type xext_id, const std::string &xid_space_name, bool xauto_access) const
Translates xext_id to an internal id using the equivalence map with name xid_space_name.
virtual schema_poset_member & schema()
The schema for this poset (mutable version).
scoped_index _row_cache_index
The index with respect to which the cached row properties were evaluated.
virtual binary_section_space_schema_member & operator=(const abstract_poset_member &xother)
Assignment operator; attaches this to the same state as xother.
virtual pod_index_type get_ext_id(pod_index_type xint_id, const std::string &xid_space_name, bool xauto_access) const
Translates xint_id to an external id using the equivalence map with name xid_space_name.
static host_type & new_host(namespace_type &xns, const poset_path &xhost_path, const poset_path &xschema_path, const poset_path &xbase_path, const poset_path &xfiber_path, const poset_path &xrep_path, bool xauto_access)
Creates a new host for members of this type in namespace xns with path xhost_path, schema specified by xschema_path, and table attributes base_space_path, fiber_space_path, and rep_path specified by xbase_path, xfiber_path, and xrep_path, respectively.
primitive_type
Type ids for sheaf primitives.
virtual void attach_handle_data_members()
Initializes the handle data members when this handle is attached to a state.
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...
size_type _row_dof_ct
The number of row dofs defined by this schema.
virtual pod_index_type get_ext_id(const std::string &xid_space_name) const
Gets an external id corresponding to index() in the id space with name xid_space_name. /.
A map from schema poset member ids to dof values for primitives_poset members.
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)
int table_dof_ct() const
The number of table dofs defined by this schema. Synonym for dof_ct(true).
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
size_type _row_dof_tuple_ub
The size in bytes of the row dof tuple defined by this schema.
virtual bool is_attached() const
True if this handle is attached to a non-void state.
dof_descriptor_array * _row_dof_descriptors
The dof_descriptors_array for the row dof tuple defined by this schema.
std::string poset_name() const
The poset name part of the path.
Definition: poset_path.cc:473
bool contains_path(const poset_path &xpath, bool xauto_access=true) const
True if this contains the poset or poset member specified by xpath.
int _version
The version of this component. The version of the host used when evaluating properties of this compon...
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. ...
binary_section_space_schema_member()
Default constructor; creates a new, unattached binary_section_space_schema_member handle...
virtual dof_descriptor_array * dof_descriptors(bool xis_table_dof) const
The dof_descriptors_array for the table dof tuple (xis_table_dof true) or row dof tuple defined by th...
SHEAF_DLL_SPEC bool is_primitive_index(pod_index_type xindex)
True if xindex is a valid primitive index.
virtual pod_index_type get_int_id(pod_index_type xext_id, const std::string &xid_space_name) const
Gets the internal id corresponding to xext_id in the id space with name xid_space_name.
int discretization_ct() const
The number of members in the intersection of the discretization subposet and the down set of the base...
virtual bool invariant() const
Class invariant.
virtual primitive_type dof_tuple_type(bool xis_table_dof) const
The type of table dofs (xis_table_dof == true) or row dofs (xis_table_dof == false) defined by this s...
An array for storing structs which describe the size, alignment, and offset of dofs within a dof tupl...
static int row_dof_ct(const namespace_poset &xns, const poset_path &xpath, bool xauto_access=true)
The number of row dofs defined by the schema specified by xns and xpath. Synonym for dof_ct(xns...
virtual sheaf::primitive_type type() const
The primitive type index of the dof defined by this.
int _row_cache_version
The version with respect to which the cached row properties were evaluated.
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
Definition: any.h:97
poset_path base_space_path(bool xauto_access) const
The path to the base space for section spaces on this schema.
virtual const scoped_index & hub_id() const
A id in the hub id space for components of this type; intended for copying to initialize ids to the h...
bool contains_poset(pod_index_type xhub_id, bool xauto_access=true) const
True if this contains a poset with hub id xhub_id..
Iterates over the subset of Zn defined by the characteristic function host().
virtual binary_section_component_iterator * component_iterator() const
A postorder iterator over the components defined by this.
virtual void detach_from_state()
Detach this handle from its state, if any.
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. ...
An abstract schema poset for a section space. A Cartesian product subspace of the tensor product of a...
bool is_table_dof() const
True if this is in the table_dofs part of some schema. Synonym for is_dof(true).
size_t row_dof_tuple_ub() const
The size in bytes of the row dof tuple defined by this schema. Synonym for dof_tuple_ub(false).
bool invariant_check() const
True if invariant checking is enabled.
Definition: any.h:79
total_poset_member & base_space()
The base space component of this (mutable version).
poset_path fiber_space_path(bool xauto_access) const
The path to the fiber space for section spaces on this schema.
Iterates in postorder over dofs of a schema member anchor. Attaches an a handle of type section_space...
poset_state_handle & fiber_schema()
The fiber schema for section spaces on this schema (mutable version).
virtual void update_row_cache(bool xupdate_id_map=false) const
Updates cached row properties.
virtual bool host_is_ancestor_of(const poset_state_handle *other) const
True if other conforms to host.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
std::string member_name() const
The member name part of the path.
Definition: poset_path.cc:511
virtual primitives_poset_dof_map & dof_map(bool xrequire_write_access=false)
The map from schema member ids or client ids to dof values for this poset member (mutable version) ...
bool is_done() const
True if iteration finished.
virtual index_iterator * get_decomposition(pod_index_type xindex) const
An iterator over the members of the decomposition identified by xindex.
A client handle for a poset member which has been prepared for use as a schema for a section space...
virtual size_t alignment() const
The alignment for this dof.
static const poset_path & standard_schema_path()
The path to the standard schema for this class.
virtual binary_section_space_schema_member * clone() const
Make a new handle, no state instance of current.
virtual bool is_dof(bool xin_table_dofs) const
True if this is in the table dofs part (xin_table_dofs == true) or in the row dofs part (xin_table_do...
static void make_standard_schema(namespace_poset &xns)
Creates standard schema for this class in namespace xns.
virtual binary_section_dof_iterator * dof_iterator(bool xis_table_dofs, int xversion=CURRENT_MEMBER_VERSION) const
A postorder iterator over the table (xis_table_dofs == true) or row (xis_table_dofs == false) dofs de...
virtual pod_index_type get_index_from_components(pod_index_type xbase_space_id, pod_index_type xfiber_schema_id) const
Computes the index associated with component ids xbase_space_id, xfiber_schema_id, and xlocal_schema_id.
An abstract client handle for a member of a poset.
virtual size_t size() const
The number of bytes in this dof.
SHEAF_DLL_SPEC bool is_valid(pod_index_type xpod_index)
True if an only if xpod_index is valid.
Definition: pod_types.cc:37
Namespace for the fiber_bundles component of the sheaf system.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
Definition: pod_types.cc:31
int _discretization_ct
The number of members in the intersection of the discretization subposet the down set of the base spa...
void enable_invariant_check() const
Enable invariant checking.
Definition: any.h:87
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.
virtual primitive_type dof_tuple_type(bool xis_table_dof) const
The type of table dofs (xis_table_dof == true) or row dofs (xis_table_dof == false) defined by this s...
virtual index_iterator indexed_member_iterator() const
An iterator for members of this poset; index version.
Definition: subposet.cc:934
bool is_row_dof() const
True if this is in in the row_dofs part of some schema. Synonym for is_dof(false).
bool has_version(int xversion) const
True if xversion is a valid version for this.
void force(int i, bool value)
Sets the i-th member to value, extends the upper bound if necessary.
Definition: zn_to_bool.cc:607
base_space_poset & base_space()
The base space for section spaces on this schema.
virtual const scoped_index & member_id(bool xauto_access) const
An id in the member hub id space; intended for copying to initialize ids to the member id space...
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710
pod_index_type _base_space_id
The member id of the base space component of this.
pod_index_type base_space_id() const
The member id of the base space component of this.