SheafSystem  0.0.0.0
array_index_space_interval.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/abstract_product_structure.h"
22 #include "SheafSystem/array_index_space_interval.h"
23 #include "SheafSystem/assert_contract.h"
24 #include "SheafSystem/array_implicit_index_space_iterator.h"
25 #include "SheafSystem/forwarding_index_space_handle.h"
26 #include "SheafSystem/explicit_index_space_state.h"
27 #include "SheafSystem/hub_index_space_handle.h"
28 #include "SheafSystem/index_space_family.h"
29 
30 // ===========================================================
31 // SPACE FACTORY FACET
32 // ===========================================================
33 
34 // PUBLIC MEMBER FUNCTIONS
35 
39  size_type xub,
40  block<pod_type>& xhub_ids,
41  size_type xids_per_space,
42  bool xowns_hub_ids)
43 {
44  // Preconditions:
45 
46  require(xub > 0);
47  require(xids_per_space > 0);
48  require(xhub_ids.ub() >= xub*xids_per_space);
49 
50  // Body:
51 
52  define_old_variable(size_type old_id_spaces_end = xid_spaces.end());
53 
55  result_ptr->new_state(xid_spaces, xub);
56 
57  result_ptr->_ids_per_space = xids_per_space;
58  result_ptr->_owns_hub_ids = xowns_hub_ids;
59 
60  if(xowns_hub_ids)
61  {
62  // Use the assignment operator of block to copy the contents of the
63  // user input into the hub ids array.
64 
65  result_ptr->_hub_ids = new block<pod_type>();
66 
67  *(result_ptr->_hub_ids) = xhub_ids;
68  }
69  else
70  {
71  // The user is responsible for the memory management, copy the point
72  // to the user input.
73 
74  result_ptr->_hub_ids = &xhub_ids;
75  }
76 
77  const array_index_space_interval& result = *result_ptr;
78 
79  // Postconditions:
80 
81  ensure(&result.id_spaces() == &xid_spaces);
82  ensure(result.begin() == old_id_spaces_end);
83  ensure(result.end() == xid_spaces.end());
84  ensure(result.end() == result.begin() + xub);
85 
86  ensure(result.hub_ids() == xhub_ids);
87  ensure(result.ids_per_space() == xids_per_space);
88  ensure(result.owns_hub_ids() == xowns_hub_ids);
89 
90  // Exit:
91 
92  return result;
93 }
94 
95 // PROTECTED MEMBER FUNCTIONS
96 
97 // PRIVATE MEMBER FUNCTIONS
98 
99 
100 // ===========================================================
101 // ARRAY_INDEX_SPACE_INTERVAL FACET
102 // ===========================================================
103 
104 // PUBLIC MEMBER FUNCTIONS
105 
108 {
109  // Preconditions:
110 
111  // Body:
112 
113  if(_owns_hub_ids)
114  {
115  delete _hub_ids;
116  }
117 
118  // Postconditions:
119 
120  // Exit:
121 
122  return;
123 }
124 
127 hub_ids() const
128 {
129  // Preconditions:
130 
131  // Body:
132 
133  // Postconditions:
134 
135  ensure(is_basic_query);
136 
137  // Exit:
138 
139  return *_hub_ids;
140 }
141 
145 {
146  // Preconditions:
147 
148  // Body:
149 
150  // Postconditions:
151 
152  ensure(is_basic_query);
153 
154  // Exit:
155 
156  return _ids_per_space;
157 }
158 
159 bool
162 {
163  // Preconditions:
164 
165  // Body:
166 
167  // Postconditions:
168 
169  ensure(is_basic_query);
170 
171  // Exit:
172 
173  return _owns_hub_ids;
174 }
175 
176 // PROTECTED MEMBER FUNCTIONS
177 
181 {
182  // Preconditions:
183 
184  // Body:
185 
186  _owns_hub_ids = false;
187  _hub_ids = 0;
188 
189  // Postconditions:
190 
191  ensure(invariant());
192 
193  // Exit:
194 
195  return;
196 }
197 
198 // PRIVATE MEMBER FUNCTIONS
199 
200 
201 // ===========================================================
202 // INDEX_SPACE_INTERVAL FACET
203 // ===========================================================
204 
205 // PUBLIC MEMBER FUNCTIONS
206 
207 // PROTECTED MEMBER FUNCTIONS
208 
209 // PRIVATE MEMBER FUNCTIONS
210 
211 
212 // ===========================================================
213 // FACTORY FACET
214 // ===========================================================
215 
216 // PUBLIC MEMBER FUNCTIONS
217 
218 const std::string&
220 class_name() const
221 {
222  static const std::string result("array_index_space_interval");
223  return result;
224 }
225 
228 clone() const
229 {
230  // Preconditions:
231 
232  // Body:
233 
236 
237  // Postconditions:
238 
239  ensure(result != 0);
240  ensure(is_same_type(result));
241 
242  // Exit:
243 
244  return result;
245 }
246 
247 // PROTECTED MEMBER FUNCTIONS
248 
249 // PRIVATE MEMBER FUNCTIONS
250 
251 bool
252 sheaf::array_index_space_interval::
253 make_prototype()
254 {
255  // Preconditions:
256 
257  // Body:
258 
260 
261  id_space_interval_factory().insert_prototype(lproto);
262 
263  // Postconditions:
264 
265  // Exit:
266 
267  return true;
268 }
269 
270 
271 // ===========================================================
272 // INDEX_SPACE_COLLECTION FACET
273 // ===========================================================
274 
275 // PUBLIC MEMBER FUNCTIONS
276 
277 bool
279 operator==(const index_space_collection& xother) const
280 {
281  // Preconditions:
282 
283  require(is_ancestor_of(&xother));
284 
285  // Body:
286 
287  const array_index_space_interval& lother =
288  dynamic_cast<const array_index_space_interval&>(xother);
289 
290  bool result = index_space_interval::operator==(xother);
291 
292  result = result && (_ids_per_space == lother._ids_per_space);
293  result = result && (_owns_hub_ids == _owns_hub_ids);
294  result = result && (_owns_hub_ids ? (*_hub_ids == *lother._hub_ids) : (_hub_ids == lother._hub_ids));
295 
296  // Postconditions:
297 
298  // Exit
299 
300  return result;
301 }
302 
305 deep_size(bool xinclude_shallow) const
306 {
307  // Preconditions:
308 
309  // Body:
310 
311  size_type result = sheaf::deep_size(*this, xinclude_shallow);
312 
313  // Postconditions:
314 
315  ensure(result >= 0);
316 
317  // Exit:
318 
319  return result;
320 }
321 
322 // PROTECTED MEMBER FUNCTIONS
323 
327 {
328  // Preconditions:
329 
330  require(is_ancestor_of(&xother));
331 
332  // Body:
333 
334  const array_index_space_interval& lother =
335  dynamic_cast<const array_index_space_interval&>(xother);
336 
338  _owns_hub_ids = lother._owns_hub_ids;
339 
340  if(_owns_hub_ids)
341  {
342  _hub_ids = new block<pod_type>();
343  *_hub_ids = *lother._hub_ids;
344  }
345  else
346  {
347  _hub_ids = lother._hub_ids;
348  }
349 
351 
352  // Postconditions:
353 
354  ensure(invariant());
355  ensure((*this) == xother);
356 
357  // Exit:
358 
359  return *this;
360 }
361 
364 explicit_state(pod_type xlocal_id) const
365 {
366  // Preconditions:
367 
368  // Body:
369 
371 
372  explicit_index_space_state* result = 0;
373 
374  // Postconditions:
375 
376  ensure(is_basic_query);
377 
378  // Exit:
379 
380  return result;
381 }
382 
383 // PRIVATE MEMBER FUNCTIONS
384 
385 
386 // ===========================================================
387 // INDEX SPACE FACET
388 // ===========================================================
389 
390 // PUBLIC MEMBER FUNCTIONS
391 
392 void
394 remove(pod_type xlocal_id)
395 {
396  // Preconditions:
397 
398  // Body:
399 
401 
402  not_implemented();
403 
404  // Postconditions:
405 
406  ensure(!contains(xlocal_id));
407 
408  // Exit:
409 
410  return;
411 }
412 
415 ct(pod_type xlocal_id) const
416 {
417  // Preconditions:
418 
419  require(contains(xlocal_id));
420 
421  // Body:
422 
423  size_type result = _ids_per_space;
424 
425  // Postconditions:
426 
427  ensure(is_basic_query);
428 
429  // Exit:
430 
431  return result;
432 }
433 
436 begin(pod_type xlocal_id) const
437 {
438  // Preconditions:
439 
440  require(contains(xlocal_id));
441 
442  // Body:
443 
444  pod_type result = 0;
445 
446  // Postconditions:
447 
448  ensure(is_basic_query);
449 
450  // Exit:
451 
452  return result;
453 }
454 
457 end(pod_type xlocal_id) const
458 {
459  // Preconditions:
460 
461  require(contains(xlocal_id));
462 
463  // Body:
464 
465  pod_type result = _ids_per_space;
466 
467  // Postconditions:
468 
469  ensure(is_basic_query);
470 
471  // Exit:
472 
473  return result;
474 }
475 
476 bool
478 contains(pod_type xlocal_id, pod_type xid) const
479 {
480  // Preconditions:
481 
482  require(contains(xlocal_id));
483 
484  // Body:
485 
486  bool result = (0 <= xid) && (xid < _ids_per_space);
487 
488  // Postconditions:
489 
490  ensure(is_basic_query);
491 
492  // Exit:
493 
494  return result;
495 }
496 
497 bool
500 {
501  // Preconditions:
502 
503  require(contains(xlocal_id));
504 
505  // Body:
506 
507  bool result = false;
508 
516 
517  pod_type lbegin = xlocal_id*_ids_per_space;
518  pod_type lend = lbegin + _ids_per_space;
519 
520  for(pod_type i = lbegin; i < lend; ++i)
521  {
522  if((*_hub_ids)[i] == xid)
523  {
524  result = true;
525  break;
526  }
527  }
528 
529  // Postconditions:
530 
531  ensure(is_basic_query);
532 
533  // Exit:
534 
535  return result;
536 }
537 
538 bool
540 contains(pod_type xlocal_id, pod_type xid, pod_type xhub_id) const
541 {
542  // Preconditions:
543 
544  require(contains(xlocal_id));
545 
546  // Body:
547 
548  bool result =
549  (0 <= xid) && (xid < _ids_per_space) &&
550  ((*_hub_ids)[(xlocal_id*_ids_per_space) + xid] == xhub_id);
551 
552  // Postconditions:
553 
554  ensure(is_basic_query);
555 
556  // Exit:
557 
558  return result;
559 }
560 
563 pod(pod_type xlocal_id, pod_type xid) const
564 {
565  // Preconditions:
566 
567  require(contains(xlocal_id));
568 
569  // Body:
570 
571  pod_type result = invalid_pod_index();
572 
580 
581  pod_type lbegin = xlocal_id*_ids_per_space;
582  pod_type lend = lbegin + _ids_per_space;
583 
584  for(pod_type i = lbegin; i < lend; ++i)
585  {
586  if((*_hub_ids)[i] == xid)
587  {
588  result = i;
589  break;
590  }
591  }
592 
593  // Postconditions:
594 
595  ensure(!is_valid(result) || contains(xlocal_id, result));
596 
597  // Exit:
598 
599  return result;
600 }
601 
604 unglued_hub_pod(pod_type xlocal_id, pod_type xid) const
605 {
606  // Preconditions:
607 
608  require(contains(xlocal_id));
609 
610  // Body:
611 
612  pod_type result =
613  ((0 <= xid) && (xid < _ids_per_space)) ?
614  (*_hub_ids)[(xlocal_id*_ids_per_space) + xid] :
616 
617  // Postconditions:
618 
619  ensure(!is_valid(result) || contains_unglued_hub(xlocal_id, result));
620 
621  // Exit:
622 
623  return result;
624 }
625 
626 bool
628 is_persistent(pod_type xlocal_id) const
629 {
630  // Preconditions:
631 
632  require(contains(xlocal_id));
633 
634  // Body:
635 
636  bool result = false;
637 
638  // Postconditions:
639 
640  ensure(is_basic_query);
641 
642  // Exit:
643 
644  return result;
645 }
646 
647 // PROTECTED MEMBER FUNCTIONS
648 
649 // PRIVATE MEMBER FUNCTIONS
650 
651 
652 // ===========================================================
653 // PRODUCT STRUCTURE FACET
654 // ===========================================================
655 
656 // PUBLIC MEMBER FUNCTIONS
657 
658 void
661  const abstract_product_structure& xproduct)
662 {
663  // Preconditions:
664 
665  require(contains(xlocal_id));
666 
667  // Body:
668 
670 
671  not_implemented();
672 
673  // Postconditions:
674 
675  ensure(has_product_structure(xlocal_id));
676 
677  // Exit:
678 
679  return;
680 }
681 
682 void
685 {
686  // Preconditions:
687 
688  require(contains(xlocal_id));
689 
690  // Body:
691 
693 
694  not_implemented();
695 
696  // Postconditions:
697 
698  ensure(!has_product_structure(xlocal_id));
699 
700  // Exit:
701 
702  return;
703 }
704 
707 product_structure(pod_type xlocal_id) const
708 {
709  // Preconditions:
710 
711  require(contains(xlocal_id));
712  require(has_product_structure(xlocal_id));
713 
714  // Body:
715 
717 
718  const abstract_product_structure* result = 0; // Just to silence compiler warnings.
719 
720  not_implemented();
721 
722  // Postconditions:
723 
724  ensure(is_basic_query);
725 
726  // Exit:
727 
728  return *result;
729 }
730 
734 {
735  // Preconditions:
736 
737  require(contains(xlocal_id));
738  require(has_product_structure(xlocal_id));
739 
740  // Body:
741 
743 
744  abstract_product_structure* result = 0; // Just to silence compiler warnings.
745 
746  not_implemented();
747 
748  // Postconditions:
749 
750  ensure(is_basic_query);
751 
752  // Exit:
753 
754  return *result;
755 }
756 
757 bool
760 {
761  // Preconditions:
762 
763  require(contains(xlocal_id));
764 
765  // Body:
766 
768 
769  bool result = false; // Just to silence compiler warnings.
770 
771  not_implemented();
772 
773  // Postconditions:
774 
775  ensure(is_basic_query);
776 
777  // Exit:
778 
779  return result;
780 }
781 
782 // PROTECTED MEMBER FUNCTIONS
783 
784 // PRIVATE MEMBER FUNCTIONS
785 
786 
787 // ===========================================================
788 // HANDLE POOL FACET
789 // ===========================================================
790 
791 // PUBLIC MEMBER FUNCTIONS
792 
795 get_id_space(pod_type xlocal_id) const
796 {
797  // Preconditions:
798 
799  require(contains(xlocal_id));
800 
801  // Body:
802 
803  index_space_handle& result = _handles.get();
804  result.attach_to(*this, xlocal_id);
805 
806  // Postconditions:
807 
808  ensure(result.is_attached());
809 
810  // Exit:
811 
812  return result;
813 }
814 
815 void
818 {
819  // Preconditions:
820 
821  require(allocated_id_space(xid_space));
822 
823  // Body:
824 
825  // Detach the handle.
826 
827  xid_space.detach();
828 
829  // Release the handle to the pool.
830 
831  _handles.release(reinterpret_cast<forwarding_index_space_handle&>(xid_space));
832 
833  // Postconditions:
834 
835  ensure(is_basic_query);
836 
837  // Exit:
838 
839  return;
840 }
841 
842 bool
844 allocated_id_space(const index_space_handle& xid_space) const
845 {
846  // Preconditions:
847 
848  // Body:
849 
850  const forwarding_index_space_handle* lid_space =
851  dynamic_cast<const forwarding_index_space_handle*>(&xid_space);
852 
853  bool result = (lid_space != 0) && _handles.allocated(*lid_space);
854 
855  // Postconditions:
856 
857  ensure(is_basic_query);
858 
859  // Exit:
860 
861  return result;
862 }
863 
864 // PROTECTED MEMBER FUNCTIONS
865 
866 // PRIVATE MEMBER FUNCTIONS
867 
868 
869 // ===========================================================
870 // ITERATOR POOL FACET
871 // ===========================================================
872 
873 // PUBLIC MEMBER FUNCTIONS
874 
878 {
879  // Preconditions:
880 
881  require(contains(xlocal_id));
882 
883  // Body:
884 
885  index_space_iterator& result = _iterators.get();
886  result.attach_to(*this, xlocal_id);
887 
888  // Postconditions:
889 
890  ensure(result.is_attached());
891 
892  // Exit:
893 
894  return result;
895 }
896 
897 void
900 {
901  // Preconditions:
902 
903  require(allocated_id_space_iterator(xitr));
904 
905  // Body:
906 
907  // Detach the iterator.
908 
909  xitr.detach();
910 
911  // Release the iterator to the pool.
912 
913  _iterators.release(reinterpret_cast<array_implicit_index_space_iterator&>(xitr));
914 
915  // Postconditions:
916 
917  ensure(is_basic_query);
918 
919  // Exit:
920 
921  return;
922 }
923 
924 bool
927 {
928  // Preconditions:
929 
930  // Body:
931 
933  dynamic_cast<const array_implicit_index_space_iterator*>(&xitr);
934 
935  bool result = (litr != 0) && _iterators.allocated(*litr);
936 
937  // Postconditions:
938 
939  ensure(is_basic_query);
940 
941  // Exit:
942 
943  return result;
944 }
945 
946 // PROTECTED MEMBER FUNCTIONS
947 
948 // PRIVATE MEMBER FUNCTIONS
949 
950 
951 // ===========================================================
952 // ANY FACET
953 // ===========================================================
954 
955 // PUBLIC MEMBER FUNCTIONS
956 
957 bool
959 is_ancestor_of(const any *other) const
960 {
961  // Preconditions:
962 
963  require(other != 0);
964 
965  // Body:
966 
967  // True if other conforms to this
968 
969  bool result = dynamic_cast<const array_index_space_interval*>(other) != 0;
970 
971  // Postconditions:
972 
973  // Exit:
974 
975  return result;
976 }
977 
978 bool
980 invariant() const
981 {
982  bool result = true;
983 
984  if(invariant_check())
985  {
986  // Prevent recursive calls to invariant
987 
989 
990  // Must satisfy base class invariant
991 
992  invariance(index_space_interval::invariant());
993 
994  // Invariances for this class:
995 
996  // Finished, turn invariant checking back on.
997 
999  }
1000 
1001  // Exit
1002 
1003  return result;
1004 }
1005 
1006 // PROTECTED MEMBER FUNCTIONS
1007 
1008 // PRIVATE MEMBER FUNCTIONS
1009 
1010 
1011 // ===========================================================
1012 // NON-MEMBER FUNCTIONS
1013 // ===========================================================
1014 
1015 size_t
1016 sheaf::
1017 deep_size(const array_index_space_interval& xn, bool xinclude_shallow)
1018 {
1019  // Preconditions:
1020 
1021  // Body:
1022 
1023  size_t result = xinclude_shallow ? sizeof(xn) : 0;
1024 
1025  // Add contributions from _hub_ids.
1026 
1031 
1032 // if(xn.owns_hub_ids())
1033 // {
1034 // result += deep_size(xn.hub_ids(), false);
1035 // }
1036 
1037  result += deep_size(*xn._hub_ids, false);
1038 
1039  // Add contributions for _handles.
1040 
1041  result += deep_size(xn._handles, false);
1042 
1043  // Add contributions for _iterators.
1044 
1045  result += deep_size(xn._iterators, false);
1046 
1047  // Postconditions:
1048 
1049  ensure(result >= 0);
1050 
1051  // Exit
1052 
1053  return result;
1054 }
virtual pod_type pod(pod_type xlocal_id, pod_type xid) const
The pod index in the space with id xlocal_id equivalent to xid in the hub id space.
pod_type end() const
The ending index of the id spaces.
size_type _ids_per_space
The number of ids per id space.
index_type ub() const
The upper bound on the storage array. The number of items current allocated in the storage array...
An abstract class that defines the product structure for an id space.
virtual pod_type unglued_hub_pod(pod_type xlocal_id, pod_type xid) const
The pod index in the unglued hub id space equivalent to xid in the id space with id xlocal_id...
virtual const index_space_family & id_spaces() const
The id space family for this (const version).
An abstract iterator over the ids of an id space.
virtual pod_type begin(pod_type xlocal_id) const
Beginning id of the space with id xlocal_id.
virtual bool has_product_structure(pod_type xlocal_id) const
True if the id space with id xlocal_id has a product structure.
const block< pod_type > & hub_ids() const
The array of hub ids.
bool _owns_hub_ids
True if this interval is responsible for the memory management of _hub_ids.
virtual index_space_interval & operator=(const index_space_collection &xother)
Assignment operator.
virtual bool invariant() const
Class invariant.
friend SHEAF_DLL_SPEC size_t deep_size(const array_index_space_interval &xn, bool xinclude_shallow)
The deep size of array_index_space_interval& xn.
virtual bool invariant() const
Class invariant.
virtual array_index_space_interval * clone() const
Virtual constructor; create a new instance of the same type at this.
virtual void detach()=0
Detach this handle form its state, if any.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
virtual bool operator==(const index_space_collection &xother) const
True if this is equivalent to xother.
virtual bool is_persistent(pod_type xlocal_id) const
True if the id space with id xlocal_id should be written to disk.
list_pool< array_implicit_index_space_iterator > _iterators
The iterator pool.
pod_index_type pod_type
The "plain old data" index type for this.
virtual pod_type end(pod_type xlocal_id) const
Ending id of the space with id xlocal_id.
virtual bool is_attached() const =0
True if this handle is attached to a state.
virtual void detach()=0
Detach this handle form its state, if any.
virtual bool allocated_id_space_iterator(const index_space_iterator &xitr) const
True if and only if id space iterator xitr was allocated by the iterator pool.
Abstract base class with useful features for all objects.
Definition: any.h:39
An implemenation of index_space_collection that adds an interface for the interval [begin()...
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.
list_pool< forwarding_index_space_handle > _handles
The handle pool.
An immutable abstract state for a space of alternate integer identifiers (aliases) for a subset of th...
An implementation of implicit_index_space_iterator for an implicit id space in an array_index_space_i...
An implementation of class index_space_handle for an forwarding_index_space_state.
bool owns_hub_ids() const
True if this interval owns the array of hub ids. If owns_hub_ids(), this interval is responsible for ...
virtual size_type ct(pod_type xlocal_id) const
The number of members for the id space with id xlocal_id.
void attach_to(const index_space_family &xid_spaces, pod_type xindex)
Attach to the state with index xindex in the id space family xid_spaces.
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
static const array_index_space_interval & new_space(index_space_family &xid_spaces, size_type xub, block< pod_type > &xhub_ids, size_type xids_per_space, bool xowns_hub_ids)
Create a new interval of id spaces with an array representation in the id space family xid_spaces wit...
virtual void release_id_space(index_space_handle &xid_space) const
Returns the id space handle xid_space to the handle pool.
virtual bool operator==(const index_space_collection &xother) const
True if this is equivalent to xother.
size_type ids_per_space() const
The number of ids per id space.
virtual index_space_handle & get_id_space(pod_type xlocal_id) const
Allocates an id space handle from the handle pool attached to state with id xlocal_id.
virtual explicit_index_space_state * explicit_state(pod_type xlocal_id) const
The explicit id space state for id xlocal_id. Returns null if there is no explicit id space for xloca...
virtual array_index_space_interval & operator=(const index_space_collection &xother)
Assignment operator.
virtual void new_product_structure(pod_type xlocal_id, const abstract_product_structure &xproduct)
Creates a new product structure for the id space with id xlocal_id by cloning the product structure...
A collection of id space states. This is a virtual class with provides an interface for accessing the...
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
Definition: any.h:97
void attach_to(const index_space_family &xid_spaces, pod_type xindex)
Attach to the state with index xindex in the id space family xid_spaces.
static factory< index_space_interval > & id_space_interval_factory()
A factory for making descendants of this class.
virtual void delete_product_structure(pod_type xlocal_id)
Deletes the product structure for the id space with id xlocal_id.
virtual void release_id_space_iterator(index_space_iterator &xitr) const
Returns the id space iterator xitr to the iterator pool.
virtual index_space_iterator & get_id_space_iterator(pod_type xlocal_id) const
Allocates an id space iterator from the iterator pool attached to state with id xlocal_id.
virtual const std::string & class_name() const
The name of this class.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
virtual bool contains_unglued_hub(pod_type xlocal_id, pod_type xid) const
True if the space with id xlocal_id contains an id equivalent to xid in the unglued hub id space...
virtual bool is_attached() const =0
True if this iterator is attached to a state.
bool invariant_check() const
True if invariant checking is enabled.
Definition: any.h:79
block< pod_type > * _hub_ids
The array of hub ids.
virtual void remove(pod_type xlocal_id)
Remove the id space with id xlocal_id.
virtual bool contains(pod_type xlocal_id, pod_type xid) const
True if the space with id xlocal_id contains id xid.
pod_type end() const
Ending space id of this interval in the id space family scope.
virtual const abstract_product_structure & product_structure(pod_type xlocal_id) const
The product structure for the id space with id xlocal_id (const version).
Factory and container for a family of id spaces.
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
pod_type begin() const
Beginning space id of this interval in the id space family scope.
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
An implementation of index_space_interval for an interval of implicit id spaces in which the hub ids ...