SheafSystem  0.0.0.0
section_space_schema_jims_index_space_state.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/section_space_schema_jims_index_space_state.h"
22 #include "SheafSystem/assert_contract.h"
23 #include "SheafSystem/ij_product_structure.h"
24 #include "SheafSystem/index_space_family.h"
25 #include "SheafSystem/section_space_schema_jims_index_space_handle.h"
26 #include "SheafSystem/section_space_schema_jims_index_space_iterator.h"
27 #include "SheafSystem/deep_size.h"
28 #include "SheafSystem/hub_index_space_handle.h"
29 
30 using namespace std;
31 using namespace fiber_bundle; // Workaround for MS C++ bug.
32 
33 // ===========================================================
34 // SPACE FACTORY FACET
35 // ===========================================================
36 
37 // PUBLIC MEMBER FUNCTIONS
38 
42  const std::string& xname,
43  const index_space_handle& xbase_space_id_space,
44  const index_space_handle& xfiber_schema_id_space,
45  const ij_product_structure& xsection_space_schema_product)
46 {
47  // Preconditions:
48 
49  require(!xname.empty());
50  require(!xid_spaces.contains(xname));
51 
52  // Body:
53 
55  lstate->new_state(xid_spaces, xname, false);
56 
57  // Initialize data members from input arguments.
58 
59  lstate->_base_space = &xbase_space_id_space.get_id_space();
60  lstate->_fiber_schema = &xfiber_schema_id_space.get_id_space();
61  lstate->_section_space_schema_product = xsection_space_schema_product.clone();
62 
63  // Initialize the product structure.
64 
65  lstate->_product =
66  new ij_product_structure(lstate->_base_space->end(), lstate->_fiber_schema->end());
67 
68  // Initialize the count and extrema.
69 
70  lstate->_begin = 0;
71  lstate->_end = lstate->_base_space->end()*lstate->_fiber_schema->end();
72  lstate->_ct = lstate->_base_space->ct()*lstate->_fiber_schema->ct();
73 
75 
76  // Postconditions:
77 
78  ensure(&result.id_spaces() == &xid_spaces);
79  ensure(xid_spaces.contains(xname));
80  ensure(result.conforms_to_state(xname));
81 
82  ensure(result.name() == xname);
83  ensure(!result.is_persistent());
84 
85  ensure(result.base_space() == xbase_space_id_space);
86  ensure(result.fiber_schema() == xfiber_schema_id_space);
87  ensure(unexecutable("result.section_space_schema_product_structure() == xsection_space_schema_product"));
88 
89  ensure(result.begin() == 0);
90  ensure(result.end() == xbase_space_id_space.end()*xfiber_schema_id_space.end());
91  ensure(result.ct() == xbase_space_id_space.ct()*xfiber_schema_id_space.ct());
92 
93  // Exit:
94 
95  return result;
96 }
97 
101  pod_index_type xid,
102  const std::string& xname,
103  const index_space_handle& xbase_space_id_space,
104  const index_space_handle& xfiber_schema_id_space,
105  const ij_product_structure& xsection_space_schema_product)
106 {
107  // Preconditions:
108 
109  require(!xid_spaces.contains(xid));
110  require(xid_spaces.is_explicit_interval(xid));
111  require(!xname.empty());
112  require(!xid_spaces.contains(xname));
113 
114  // Body:
115 
117  lstate->new_state(xid_spaces, xid, xname, false);
118 
119  // Initialize data members from input arguments.
120 
121  lstate->_base_space = &xbase_space_id_space.get_id_space();
122  lstate->_fiber_schema = &xfiber_schema_id_space.get_id_space();
123  lstate->_section_space_schema_product = xsection_space_schema_product.clone();
124 
125  // Initialize the product structure.
126 
127  lstate->_product =
128  new ij_product_structure(lstate->_base_space->end(), lstate->_fiber_schema->end());
129 
130  // Initialize the count and extrema.
131 
132  lstate->_begin = 0;
133  lstate->_end = lstate->_base_space->end()*lstate->_fiber_schema->end();
134  lstate->_ct = lstate->_base_space->ct()*lstate->_fiber_schema->ct();
135 
137 
138  // Postconditions:
139 
140  ensure(&result.id_spaces() == &xid_spaces);
141  ensure(xid_spaces.contains(xname));
142  ensure(result.conforms_to_state(xname));
143 
144  ensure(result.index() == xid);
145  ensure(result.name() == xname);
146  ensure(!result.is_persistent());
147 
148  ensure(result.base_space() == xbase_space_id_space);
149  ensure(result.fiber_schema() == xfiber_schema_id_space);
150  ensure(unexecutable("result.section_space_schema_product_structure() == xsection_space_schema_product"));
151 
152  ensure(result.begin() == 0);
153  ensure(result.end() == xbase_space_id_space.end()*xfiber_schema_id_space.end());
154  ensure(result.ct() == xbase_space_id_space.ct()*xfiber_schema_id_space.ct());
155 
156  // Exit:
157 
158  return result;
159 }
160 
161 // PROTECTED MEMBER FUNCTIONS
162 
163 // PRIVATE MEMBER FUNCTIONS
164 
165 
166 // ===========================================================
167 // SECTION_SPACE_SCHEMA_JIMS_INDEX_SPACE_STATE FACET
168 // ===========================================================
169 
170 // PUBLIC MEMBER FUNCTIONS
171 
172 // PROTECTED MEMBER FUNCTIONS
173 
177  _base_space(0),
178  _fiber_schema(0),
179  _section_space_schema_product(0)
180 {
181  // Preconditions:
182 
183  // Body:
184 
185  // Postconditions:
186 
187  ensure(invariant());
188  ensure(is_empty());
189 
190  // Exit:
191 
192  return;
193 }
194 
197 {
198  // Preconditions:
199 
200  // Body:
201 
202  if(_base_space != 0)
203  {
205  }
206 
207  if(_fiber_schema != 0)
208  {
210  }
211 
213  {
215  }
216 
217  // Postconditions:
218 
219  // Exit:
220 
221  return;
222 }
223 
224 // PRIVATE MEMBER FUNCTIONS
225 
226 
227 // ===========================================================
228 // SECTION SPACE SCHEMA INDEX SPACE FACET
229 // ===========================================================
230 
231 // PUBLIC MEMBER FUNCTIONS
232 
233 void
235 put_factors(const index_space_handle& xbase_space_id_space,
236  const index_space_handle& xfiber_schema_id_space,
237  const ij_product_structure& xsection_space_schema_product)
238 {
239  // Preconditions:
240 
241  // Body:
242 
243  // Initialize data members from input arguments.
244 
245  _base_space = &xbase_space_id_space.get_id_space();
246 
247  _fiber_schema = &xfiber_schema_id_space.get_id_space();
248 
249  _section_space_schema_product = xsection_space_schema_product.clone();
250 
251  // Update the data members.
252 
253  update();
254 
255  // Postconditions:
256 
257  ensure(invariant());
258  ensure(is_consistent());
259 
260  // Exit:
261 
262  return;
263 }
264 
267 base_space() const
268 {
269  // Preconditions:
270 
271  // Body:
272 
273  // Postconditions:
274 
275  ensure(is_basic_query);
276 
277  // Exit:
278 
279  return *_base_space;
280 }
281 
285 {
286  // Preconditions:
287 
288  // Body:
289 
290  // Postconditions:
291 
292  ensure(is_basic_query);
293 
294  // Exit:
295 
296  return *_fiber_schema;
297 }
298 
302 {
303  // Preconditions:
304 
305  // Body:
306 
307  // Postconditions:
308 
309  ensure(is_basic_query);
310 
311  // Exit:
312 
314 }
315 
316 bool
319 {
320  // Preconditions:
321 
322  // Body:
323 
324  bool result =
325  (_ct == _base_space->ct()*_fiber_schema->ct()) &&
326  (_product->ub(0) == _base_space->end()) &&
327  (_product->ub(1) == _fiber_schema->end());
328 
329  // Postconditions:
330 
331  ensure(is_basic_query);
332 
333  // Exit:
334 
335  return result;
336 }
337 
338 void
341 {
342  // Preconditions:
343 
344  // Body:
345 
346  // Update the product structure.
347 
349 
350  // Update the count and end.
351 
354 
355  // Postconditions:
356 
357  ensure(is_consistent());
358 
359  // Exit:
360 
361  return;
362 }
363 
364 // PROTECTED MEMBER FUNCTIONS
365 
366 // PRIVATE MEMBER FUNCTIONS
367 
368 
369 // ===========================================================
370 // EXPLICIT_INDEX_SPACE_STATE FACET
371 // ===========================================================
372 
373 // PUBLIC MEMBER FUNCTIONS
374 
375 bool
378 {
379  // Preconditions:
380 
381  require(is_ancestor_of(&xother));
382 
383  // Body:
384 
386  dynamic_cast<const section_space_schema_jims_index_space_state&>(xother);
387 
388  bool result = explicit_index_space_state::operator==(xother);
389  result = result && (*_base_space == *lother._base_space);
390  result = result && (*_fiber_schema == *lother._fiber_schema);
391  result = result && (*_section_space_schema_product ==
393 
394  // Postconditions:
395 
396  // Exit
397 
398  return result;
399 }
400 
403 deep_size(bool xinclude_shallow) const
404 {
405  // Preconditions:
406 
407  // Body:
408 
409  size_type result = fiber_bundle::deep_size(*this, xinclude_shallow);
410 
411  // Postconditions:
412 
413  ensure(result >= 0);
414 
415  // Exit:
416 
417  return result;
418 }
419 
420 // PROTECTED MEMBER FUNCTIONS
421 
425 {
426  // Preconditions:
427 
428  require(is_ancestor_of(&xother));
429 
430  // Body:
431 
433  dynamic_cast<const section_space_schema_jims_index_space_state&>(xother);
434 
435  _base_space = &lother._base_space->get_id_space();
438 
439  (void) explicit_index_space_state::operator=(xother);
440 
441  // Postconditions:
442 
443  ensure(invariant());
444  ensure((*this) == xother);
445 
446  // Exit
447 
448  return *this;
449 }
450 
451 // PRIVATE MEMBER FUNCTIONS
452 
453 
454 // ===========================================================
455 // INDEX SPACE FACET
456 // ===========================================================
457 
458 // PUBLIC MEMBER FUNCTIONS
459 
460 bool
462 contains(pod_type xid) const
463 {
464  // Preconditions:
465 
466  // Body:
467 
468  // Compute the tuple ids in the jims id space.
469 
470  pod_type lbase_id, lfiber_id;
471  product_structure().tuple(xid, lbase_id, lfiber_id);
472 
473  // Only contains xid if the tuple values are in the
474  // base space and fiber schema id spaces.
475 
476  bool result =
477  _base_space->contains(lbase_id) && _fiber_schema->contains(lfiber_id);
478 
479  // Postconditions:
480 
481  ensure(is_basic_query);
482 
483  // Exit
484 
485  return result;
486 }
487 
488 bool
491 {
492  // Preconditions:
493 
494  // Body:
495 
496  // Compute the tuple ids in the hub id space.
497 
498  pod_type lbase_hub_id, lfiber_hub_id;
499  _section_space_schema_product->tuple(xhub_id, lbase_hub_id, lfiber_hub_id);
500 
501  // Only contains xid if the tuple values are in the
502  // base space and fiber schema id spaces.
503 
504  bool result =
505  _base_space->contains_unglued_hub(lbase_hub_id) &&
506  _fiber_schema->contains_unglued_hub(lfiber_hub_id);
507 
508  // Postconditions:
509 
510  ensure(is_basic_query);
511 
512  // Exit
513 
514  return result;
515 }
516 
519 pod(pod_type xhub_id) const
520 {
521  // Preconditions:
522 
523  // Body:
524 
525  pod_type result;
526 
527  // Compute the tuple ids in the hub id space.
528 
529  pod_type lbase_hub_id, lfiber_hub_id;
530  _section_space_schema_product->tuple(xhub_id, lbase_hub_id, lfiber_hub_id);
531 
532  // Map into the jims id space.
533 
534  pod_type lbase_id = _base_space->pod(lbase_hub_id);
535  pod_type lfiber_id = _fiber_schema->pod(lfiber_hub_id);
536 
537  // Compute the ordinal in the this id space.
538 
539  if(is_valid(lbase_id) && is_valid(lfiber_id))
540  {
541  product_structure().ordinal(lbase_id, lfiber_id, result);
542  }
543  else
544  {
545  result = invalid_pod_index();
546  }
547 
548  // Postconditions:
549 
550  ensure(!is_valid(result) || contains(result));
551 
552  // Exit
553 
554  return result;
555 }
556 
560 {
561  // Preconditions:
562 
563  // Body:
564 
565  pod_type result;
566 
567  // Compute the tuple ids in the jims id space.
568 
569  pod_type lbase_id, lfiber_id;
570  product_structure().tuple(xid, lbase_id, lfiber_id);
571 
572  // Map tuple ids into the hub id space.
573 
574  pod_type lbase_hub_id = _base_space->hub_pod(lbase_id);
575  pod_type lfiber_hub_id = _fiber_schema->hub_pod(lfiber_id);
576 
577  // Compute the ordinal id in the hub id space.
578 
579  if(is_valid(lbase_hub_id) && is_valid(lfiber_hub_id))
580  {
581  _section_space_schema_product->ordinal(lbase_hub_id, lfiber_hub_id, result);
582  }
583  else
584  {
585  result = invalid_pod_index();
586  }
587 
588  // Postconditions:
589 
590  ensure(!is_valid(result) || contains_unglued_hub(result));
591 
592  // Exit:
593 
594  return result;
595 }
596 
597 // PROTECTED MEMBER FUNCTIONS
598 
599 // PRIVATE MEMBER FUNCTIONS
600 
601 
602 // ===========================================================
603 // PRODUCT STRUCTURE FACET
604 // ===========================================================
605 
606 // PUBLIC MEMBER FUNCTIONS
607 
608 void
611 {
612  // Preconditions:
613 
614  // Body:
615 
616  not_implemented();
617 
618  // Postconditions:
619 
620  ensure(has_product_structure());
621 
622  // Exit:
623 
624  return;
625 }
626 
627 void
630 {
631  // Preconditions:
632 
633  // Body:
634 
635  not_implemented();
636 
637  // Postconditions:
638 
639  ensure(!has_product_structure());
640 
641  // Exit:
642 
643  return;
644 }
645 
649 {
650  // Preconditions:
651 
652  require(has_product_structure());
653 
654  // Body:
655 
656  const ij_product_structure& result =
657  reinterpret_cast<ij_product_structure&>(*_product);
658 
659  // Postconditions:
660 
661  ensure(is_basic_query);
662 
663  // Exit:
664 
665  return result;
666 }
667 
671 {
672  // Preconditions:
673 
674  require(has_product_structure());
675 
676  // Body:
677 
678  ij_product_structure& result =
679  reinterpret_cast<ij_product_structure&>(*_product);
680 
681  // Postconditions:
682 
683  ensure(is_basic_query);
684 
685  // Exit:
686 
687  return result;
688 }
689 
690 // PROTECTED MEMBER FUNCTIONS
691 
692 // PRIVATE MEMBER FUNCTIONS
693 
694 
695 // ===========================================================
696 // HANDLE POOL FACET
697 // ===========================================================
698 
699 // PUBLIC MEMBER FUNCTIONS
700 
704 {
705  // Preconditions:
706 
707  // Body:
708 
709  size_type result = handles().ct();
710 
711  // Postconditions:
712 
713  ensure(result >= 0);
714 
715  // Exit:
716 
717  return result;
718 }
719 
723 {
724  // Preconditions:
725 
726  // Body:
727 
728  size_type result = sheaf::deep_size(handles(), true);
729 
730  // Postconditions:
731 
732  ensure(result >= 0);
733 
734  // Exit:
735 
736  return result;
737 }
738 
742 {
743  // Preconditions:
744 
745  // Body:
746 
747  section_space_schema_jims_index_space_handle& result = handles().get();
748  attach(result);
749 
750  // Postconditions:
751 
752  ensure(result.is_attached());
753 
754  // Exit:
755 
756  return result;
757 }
758 
759 void
762 {
763  // Preconditions:
764 
765  require(allocated_id_space(xid_space));
766 
767  // Body:
768 
769  // Detach the handle.
770 
771  xid_space.detach();
772 
773  // Release the handle to the pool.
774 
775  handles().release(reinterpret_cast<section_space_schema_jims_index_space_handle&>(xid_space));
776 
777  // Postconditions:
778 
779  ensure(is_basic_query);
780 
781  // Exit:
782 
783  return;
784 }
785 
786 bool
788 allocated_id_space(const index_space_handle& xid_space) const
789 {
790  // Preconditions:
791 
792  // Body:
793 
795  dynamic_cast<const section_space_schema_jims_index_space_handle*>(&xid_space);
796 
797  bool result = (lid_space != 0) && handles().allocated(*lid_space);
798 
799  // Postconditions:
800 
801  ensure(is_basic_query);
802 
803  // Exit:
804 
805  return result;
806 }
807 
808 // PROTECTED MEMBER FUNCTIONS
809 
810 // PRIVATE MEMBER FUNCTIONS
811 
813 fiber_bundle::section_space_schema_jims_index_space_state::
814 handles()
815 {
816  // Preconditions:
817 
818  // Body:
819 
821 
822  // Postconditions:
823 
824  ensure(is_basic_query);
825 
826  // Exit:
827 
828  return result;
829 }
830 
831 
832 // ===========================================================
833 // ITERATOR POOL FACET
834 // ===========================================================
835 
836 // PUBLIC MEMBER FUNCTIONS
837 
841 {
842  // Preconditions:
843 
844  // Body:
845 
846  size_type result = iterators().ct();
847 
848  // Postconditions:
849 
850  ensure(result >= 0);
851 
852  // Exit:
853 
854  return result;
855 }
856 
860 {
861  // Preconditions:
862 
863  // Body:
864 
865  size_type result = sheaf::deep_size(iterators(), true);
866 
867  // Postconditions:
868 
869  ensure(result >= 0);
870 
871  // Exit:
872 
873  return result;
874 }
875 
879 {
880  // Preconditions:
881 
882  // Body:
883 
884  section_space_schema_jims_index_space_iterator& result = iterators().get();
885  attach(result);
886 
887  // Postconditions:
888 
889  ensure(result.is_attached());
890 
891  // Exit:
892 
893  return result;
894 }
895 
896 void
899 {
900  // Preconditions:
901 
902  require(allocated_iterator(xitr));
903 
904  // Body:
905 
906  // Detach the iterator.
907 
908  xitr.detach();
909 
910  // Release the iterator to the pool.
911 
912  iterators().release(reinterpret_cast<section_space_schema_jims_index_space_iterator&>(xitr));
913 
914  // Postconditions:
915 
916  ensure(is_basic_query);
917 
918  // Exit:
919 
920  return;
921 }
922 
923 bool
926 {
927  // Preconditions:
928 
929  // Body:
930 
932  dynamic_cast<const section_space_schema_jims_index_space_iterator*>(&xitr);
933 
934  bool result = (litr != 0) && iterators().allocated(*litr);
935 
936  // Postconditions:
937 
938  ensure(is_basic_query);
939 
940  // Exit:
941 
942  return result;
943 }
944 
945 // PROTECTED MEMBER FUNCTIONS
946 
947 // PRIVATE MEMBER FUNCTIONS
948 
950 fiber_bundle::section_space_schema_jims_index_space_state::
951 iterators()
952 {
953  // Preconditions:
954 
955  // Body:
956 
958 
959  // Postconditions:
960 
961  ensure(is_basic_query);
962 
963  // Exit:
964 
965  return result;
966 }
967 
968 
969 // ===========================================================
970 // FACTORY FACET
971 // ===========================================================
972 
973 // PUBLIC MEMBER FUNCTIONS
974 
975 const std::string&
977 class_name() const
978 {
979  static const string result("section_space_schema_jims_index_space_state");
980  return result;
981 }
982 
985 clone() const
986 {
987  // Preconditions:
988 
989  // Body:
990 
992 
993  // Postconditions:
994 
995  ensure(result != 0);
996  ensure(is_same_type(result));
997 
998  // Exit:
999 
1000  return result;
1001 }
1002 
1003 // PROTECTED MEMBER FUNCTIONS
1004 
1005 // PRIVATE MEMBER FUNCTIONS
1006 
1007 bool
1008 fiber_bundle::section_space_schema_jims_index_space_state::
1009 make_prototype()
1010 {
1011  // Preconditions:
1012 
1013  // Body:
1014 
1016 
1017  id_space_factory().insert_prototype(lproto);
1018 
1019  // Postconditions:
1020 
1021  // Exit:
1022 
1023  return true;
1024 }
1025 
1026 
1027 // ===========================================================
1028 // ANY FACET
1029 // ===========================================================
1030 
1031 // PUBLIC MEMBER FUNCTIONS
1032 
1033 bool
1035 is_ancestor_of(const any *other) const
1036 {
1037  // Preconditions:
1038 
1039  require(other != 0);
1040 
1041  // Body:
1042 
1043  // True if other conforms to this
1044 
1045  bool result = dynamic_cast<const section_space_schema_jims_index_space_state*>(other) != 0;
1046 
1047  // Postconditions:
1048 
1049  // Exit:
1050 
1051  return result;
1052 }
1053 
1054 bool
1056 invariant() const
1057 {
1058  bool result = true;
1059 
1060  if(invariant_check())
1061  {
1062  // Prevent recursive calls to invariant
1063 
1065 
1066  // Must satisfy base class invariant
1067 
1069 
1070  // Invariances for this class:
1071 
1072  invariance(!has_product_structure() || (product_structure().ub(0) == base_space().end()));
1073  invariance(!has_product_structure() || (product_structure().ub(1) == fiber_schema().end()));
1074 
1075  // Finished, turn invariant checking back on.
1076 
1078  }
1079 
1080  // Exit
1081 
1082  return result;
1083 }
1084 
1085 // PROTECTED MEMBER FUNCTIONS
1086 
1087 // PRIVATE MEMBER FUNCTIONS
1088 
1089 
1090 // ===========================================================
1091 // NON-MEMBER FUNCTIONS
1092 // ===========================================================
1093 
1094 size_t
1095 fiber_bundle::
1096 deep_size(const section_space_schema_jims_index_space_state& xn, bool xinclude_shallow)
1097 {
1098  // Preconditions:
1099 
1100  // Body:
1101 
1102  size_t result = xinclude_shallow ? sizeof(xn) : 0;
1103 
1104  // Add contribution from _section_space_schema_product.
1105 
1106  result += deep_size(xn.section_space_schema_product_structure(), false);
1107 
1108  // Postconditions:
1109 
1110  ensure(result >= 0);
1111 
1112  // Exit
1113 
1114  return result;
1115 }
abstract_product_structure * _product
The product structure for this id space.
virtual section_space_schema_jims_index_space_state & operator=(const explicit_index_space_state &xother)
Assignment operator.
virtual bool allocated_id_space(const index_space_handle &xid_space) const
True if and only if id space handle xid_space was allocated by the handle pool.
An implementation of class explicit_index_space_handle that has a section space schema jims id space ...
virtual pod_type index() const
Index of this space.
An abstract class that defines the product structure for an id space.
virtual bool contains(pod_type xid) const
True if this space contains id xid.
virtual section_space_schema_jims_index_space_state * clone() const
Virtual constructor; create a new instance of the same type at this.
virtual pod_type end() const =0
Ending id of this space.
An abstract iterator over the ids of an id space.
static size_type iterator_pool_ct()
The number of iterators in the pool.
pod_type end() const
Ending id of this space.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
void put_factors(const index_space_handle &xbase_space_id_space, const index_space_handle &xfiber_schema_id_space, const ij_product_structure &xsection_space_schema_product)
Set the factors for this section space schema id space.
virtual void delete_product_structure()
Deletes the product structure for this id space.
virtual size_type ub(pod_type xi) const =0
The upper-bound for the dimension xi.
void put_ubs(size_type xi_ub, size_type xj_ub)
Set the upper-bounds for this product structure.
const index_space_handle & fiber_schema() const
The fiber schema jims id space.
virtual bool is_persistent() const
True if this id space should be written to disk.
virtual bool operator==(const explicit_index_space_state &xother) const
True if this is equivalent to xother.
STL namespace.
virtual void detach()=0
Detach this handle form its state, if any.
virtual const index_space_family & id_spaces() const
The id space family for this (const version).
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
void tuple(pod_type xordinal, pod_type &xi, pod_type &xj) const
Ordinal to 2-tuple conversion.
virtual const std::string & class_name() const
The name of this class.
virtual void release_id_space() const =0
Returns this id space handle to the handle pool.
virtual bool operator==(const explicit_index_space_state &xother) const
True if this is equivalent to xother.
virtual index_space_handle & get_id_space() const =0
Allocates an id space handle from the handle pool attached to the same id space.
bool has_product_structure() const
True if this id space has a product structure.
virtual void detach()=0
Detach this handle form its state, if any.
virtual bool contains(pod_type xid) const =0
True if this space contains id xid.
bool is_consistent() const
True, if this id space is consistent with the base space and the fiber schema jims id spaces...
virtual bool conforms_to_state(const index_space_collection &xhost, pod_type xlocal_id) const
True if this conforms to the handle type required by the state with local scope id xlocal_id in the h...
void attach(explicit_index_space_handle &xid_space) const
Attach the id space handle xid_space to this state.
pod_type _end
Ending id of this space.
virtual ij_product_structure * clone() const
Virtual constructor, makes a new instance of the same type as this.
Abstract base class with useful features for all objects.
Definition: any.h:39
virtual index_space_handle & get_id_space() const
The id space handle with this state.
const ij_product_structure & section_space_schema_product_structure() const
The product structure of the section space schema id space.
An immutable abstract state for a space of alternate integer identifiers (aliases) for a subset of th...
virtual index_space_iterator & get_iterator() const
Allocates an id space iterator from the iterator pool.
std::string name() const
Name of this space.
virtual bool is_attached() const
True if this handle is attached to a state.
SHEAF_DLL_SPEC size_t deep_size(const dof_descriptor_array &xp, bool xinclude_shallow=true)
The deep size of the referenced object of type dof_descriptor_array.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
const index_space_handle & base_space() const
The base space jims id space.
bool is_explicit_interval(pod_type xid)
True, if and only if the id space interval that contains index xid is an explicit interval...
virtual bool contains_unglued_hub(pod_type xid) const
True if this space contains an id equivalent to xid in the unglued hub id space.
virtual size_type ct() const =0
The number of members.
static section_space_schema_jims_index_space_handle new_space(index_space_family &xid_spaces, const std::string &xname, const index_space_handle &xbase_space_id_space, const index_space_handle &xfiber_schema_id_space, const ij_product_structure &xsection_space_schema_product)
Create a new section space schema jims id space in the id space family xid_space at the next availabl...
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
Definition: any.h:97
virtual bool contains_unglued_hub(pod_type xid) const =0
True if this space contains an id equivalent to xid in the unglued hub id space.
virtual pod_type pod(pod_type xid) const =0
The pod index in this space equivalent to xid in the hub id space.
void ordinal(pod_type xi, pod_type xj, pod_type &xordinal) const
2-tuple to ordinal conversion.
virtual pod_type unglued_hub_pod(pod_type xid) const
The pod index in the unglued hub id space equivalent to xid in this id space.
SHEAF_DLL_SPEC size_t deep_size(const sec_vd &x0, bool xinclude_shallow=true)
The deep size of the referenced object of type sec_vd. if xinclude_shallow, add the sizeof x0 to the ...
Definition: sec_vd.cc:1448
virtual pod_type pod(pod_type xid) const
The pod index in this space equivalent to xid in the hub id space.
virtual void new_product_structure(const abstract_product_structure &xproduct)
Creates a new product structure for this id space by cloning the product structure, xproduct.
pod_type hub_pod(pod_type xid) const
The pod index in the unglued hub id space equivalent to xid in this id space; synonym for unglued_hub...
size_type _ct
The number of members.
virtual pod_type begin() const
Beginning id of this space.
bool invariant_check() const
True if invariant checking is enabled.
Definition: any.h:79
virtual void release_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the iterator pool.
pod_index_type pod_type
The "plain old data" index type for this.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
A 2D implementation of abstract_product_structure.
virtual size_type deep_size(bool xinclude_shallow) const
The deep size of this.
virtual bool invariant() const
Class invariant.
An implementation class explicit_index_space_state for the jims id space of the section space schema...
bool contains(pod_type xid) const
True, if this contains an id space with id xid.
const index_space_handle & base_space() const
The base space jims id space.
virtual pod_type end() const
Ending id of this space.
ij_product_structure * _section_space_schema_product
The product structure of the section space schema id space.
virtual size_type ct() const
The number of members.
bool is_empty() const
True if there are no ids in the space.
Factory and container for a family of id spaces.
An iterator over an id space in which the equivalence between the ids in the space and the hub id spa...
const ij_product_structure & product_structure() const
The product structure for this id space (const version).
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
static factory< explicit_index_space_state > & id_space_factory()
A factory for making descendants of this class.
virtual void release_id_space(index_space_handle &xid_space) const
Release the id space handle xid_space.
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
bool is_same_type(const any *other) const
True if other is the same type as this.
Definition: any.cc:79
void enable_invariant_check() const
Enable invariant checking.
Definition: any.h:87
virtual bool is_attached() const
True if this iterator is attached to a state.
A reallocated pool of objects of type T. Objects in the pool are either allocated or stored in a free...
Definition: list_pool.h:42
virtual bool allocated_iterator(const index_space_iterator &xitr) const
True if and only if id space iterator xitr was allocated by the iterator pool.
static size_type iterator_pool_deep_size()
The deep size of the iterator pool.
const index_space_handle & fiber_schema() const
The fiber schema jims id space.
void update()
Make this id space consistent with the base space and fiber schema jims id spaces.