SheafSystem  0.0.0.0
gathered_insertion_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/gathered_insertion_index_space_state.h"
22 #include "SheafSystem/assert_contract.h"
23 #include "SheafSystem/index_space_iterator.h"
24 #include "SheafSystem/gathered_insertion_index_space_handle.h"
25 #include "SheafSystem/scoped_index.h"
26 
27 // ===========================================================
28 // GATHERED_INSERTION_INDEX_SPACE_STATE FACET
29 // ===========================================================
30 
31 // PUBLIC MEMBER FUNCTIONS
32 
33 // PROTECTED MEMBER FUNCTIONS
34 
38 {
39  // Preconditions:
40 
41  // Body:
42 
43  // Postconditions:
44 
45  ensure(invariant());
46  ensure(is_empty());
47 
48  // Exit:
49 
50  return;
51 }
52 
55 {
56  // Preconditions:
57 
58  // Body:
59 
60  // nothing to do.
61 
62  // Postconditions:
63 
64  // Exit:
65 
66  return;
67 }
68 
69 // PRIVATE MEMBER FUNCTIONS
70 
71 
72 // ===========================================================
73 // GATHERED_INSERTION INDEX SPACE FACET
74 // ===========================================================
75 
76 // PUBLIC MEMBER FUNCTIONS
77 
78 void
80 push_back(const scoped_index& xhub_id)
81 {
82  // Preconditions:
83 
84  require(xhub_id.in_scope());
85  require(precondition_of(push_back(xhub_id.hub_pod())));
86 
87  // Body:
88 
89  push_back(xhub_id.hub_pod());
90 
91  // Postconditions:
92 
93  ensure(postcondition_of(push_back(xhub_id.hub_pod())));
94 
95  // Exit:
96 
97  return;
98 }
99 
100 void
103 {
104  // Preconditions:
105 
106  // Body:
107 
108  define_old_variable(size_type old_ct = _ct);
109  define_old_variable(pod_type old_begin = _begin);
110  define_old_variable(pod_type old_end = _end);
111 
112  pod_type old_next_id = next_id();
113 
114  // Insert the entry in the map representation.
115 
116  map_rep_push_back(xhub_id);
117 
118  // Update the count.
119 
120  ++_ct;
121 
122  // Update the extrema.
123 
124  update_extrema(old_next_id);
125 
126  // Postconditions:
127 
128  // $$SCRIBBLE: need to express effect of push_back on next_id()
129 
130  ensure(invariant());
131  ensure(contains(old_next_id, xhub_id));
132  ensure(ct() == old_ct + 1);
133  ensure(ct() > 1 ? begin() <= old_begin : true);
134  ensure(end() == old_next_id+1);
135 
136  // Exit:
137 
138  return;
139 }
140 
141 void
143 push(index_space_iterator& xitr, const scoped_index& xhub_id)
144 {
145  // Preconditions:
146 
147  require(xhub_id.is_scoped());
148  require(precondition_of(push(xitr, xhub_id.pod())));
149 
150  // Body:
151 
152  push(xitr, xhub_id.pod());
153 
154  // Postconditions:
155 
156  ensure(postcondition_of(push(xitr, xhub_id.pod())));
157 
158  // Exit:
159 
160  return;
161 }
162 
163 void
166 {
167  // Preconditions:
168 
169  require(allocated_iterator(xitr));
170  require(!xitr.is_done());
171  require(is_valid(xhub_id));
172  require(!contains_hub(xhub_id));
173  require(hub_id_space().contains(xhub_id));
174 
175  // Body:
176 
177  define_old_variable(size_type old_ct = _ct);
178  define_old_variable(pod_type old_begin = _begin);
179  define_old_variable(pod_type old_end = _end);
180  define_old_variable(pod_type old_itr_hub_id = xitr.hub_pod());
181 
182  pod_type old_itr_id = xitr.pod();
183 
184  // Insert the entry in the map representation.
185 
186  map_rep_push(xitr, xhub_id);
187 
188  // Update the count.
189 
190  ++_ct;
191 
192  // Update the extrema.
193 
194  if(_ct > 1)
195  {
196  ++_end;
197  }
198  else
199  {
200  // First entry, set extrema.
201 
202  _begin = old_itr_id;
203  _end = old_itr_id + 1;
204  }
205 
206  // Postconditions:
207 
208  ensure(invariant());
209  ensure(contains(old_itr_id, xhub_id));
210  ensure(ct() == old_ct + 1);
211  ensure(ct() > 1 ? begin() == old_begin : true);
212  ensure(ct() > 1 ? end() == old_end + 1 : true);
213  ensure(xitr.pod() == old_itr_id+1);
214  ensure(xitr.hub_pod() == old_itr_hub_id);
215 
216  // Exit:
217 
218  return;
219 }
220 
223 next_id() const
224 {
225  // Preconditions:
226 
227  // Body:
228 
229  pod_type result = (is_empty() ? 0 : end());
230 
231  // Postconditions:
232 
233  // $$SCRIBBLE: next_id is not redefined anywhere. The following postcondition is incorrect,
234  // it is not a basic query, it is derived from is_empty and end.
235 
236  ensure(is_basic_query);
237 
238  // Exit:
239 
240  return result;
241 }
242 
245 remove(const scoped_index& xid, bool xupdate_extrema)
246 {
247  // Preconditions:
248 
249  require(xid.in_scope());
250  require(precondition_of(remove_hub(xid.hub_pod(), xupdate_extrema)));
251 
252  // Body:
253 
254  size_type result = remove_hub(xid.hub_pod(), xupdate_extrema);
255 
256  // Postconditions:
257 
258  ensure(postcondition_of(remove_hub(xid.hub_pod(), xupdate_extrema)));
259 
260  // Exit
261 
262  return result;
263 }
264 
267 remove(pod_type xid, bool xupdate_extrema)
268 {
269  // Preconditions:
270 
271  // Body:
272 
273  define_old_variable(size_type old_ct = _ct);
274  define_old_variable(pod_type old_begin = _begin);
275  define_old_variable(pod_type old_end = _end);
276  define_old_variable(pod_type old_hub_pod = hub_pod(xid));
277 
278  // Remove the entry from the map representation.
279 
280  size_type result = map_rep_remove_entry(xid, false);
281 
282  if(result != 0)
283  {
284  // Update the count.
285 
286  --_ct;
287 
288  if(xupdate_extrema)
289  {
290  // Update the extrema.
291 
293  }
294  }
295 
296  // Postconditions:
297 
298  // ensure(!contains(xid));
299  ensure(!contains(xid, old_hub_pod));
300  ensure((result != 0) ? ct() == old_ct - 1 : ct() == old_ct);
301  ensure((result == 0) || xupdate_extrema || begin() == old_begin);
302  ensure((result == 0) || xupdate_extrema || end() == old_end);
303  ensure((result != 0) && xupdate_extrema && is_empty() ? !is_valid(begin()) : true);
304  ensure((result != 0) && xupdate_extrema && is_empty() ? !is_valid(end()) : true);
305  ensure((result != 0) && xupdate_extrema && !is_empty() ? begin() >= old_begin : true);
306  ensure((result != 0) && xupdate_extrema && !is_empty() ? end() <= old_end : true);
307 
308  // Exit:
309 
310  return result;
311 }
312 
315 remove_hub(pod_type xhub_id, bool xupdate_extrema)
316 {
317  // Preconditions:
318 
319  // Body:
320 
321  define_old_variable(pod_type old_id = pod(xhub_id));
322  define_old_variable(size_type old_ct = _ct);
323  define_old_variable(pod_type old_begin = _begin);
324  define_old_variable(pod_type old_end = _end);
325  define_old_variable(pod_type old_pod = pod(xhub_id));
326 
327  // Remove the entry from the map representation.
328 
329  size_type result = map_rep_remove_entry(xhub_id, true);
330 
331  if(result != 0)
332  {
333  // Update the count.
334 
335  --_ct;
336 
337  if(xupdate_extrema)
338  {
339  // Update the extrema.
340 
342  }
343  }
344 
345  // Postconditions:
346 
347  ensure(!contains_hub(xhub_id));
348  ensure((result != 0) ? ct() == old_ct - 1 : ct() == old_ct);
349  ensure((result == 0) || xupdate_extrema || begin() == old_begin);
350  ensure((result == 0) || xupdate_extrema || end() == old_end);
351  ensure((result != 0) && xupdate_extrema && is_empty() ? !is_valid(begin()) : true);
352  ensure((result != 0) && xupdate_extrema && is_empty() ? !is_valid(end()) : true);
353  ensure((result != 0) && xupdate_extrema && !is_empty() ? begin() >= old_begin : true);
354  ensure((result != 0) && xupdate_extrema && !is_empty() ? end() <= old_end : true);
355 
356  // Exit:
357 
358  return result;
359 }
360 
361 void
363 remove(index_space_iterator& xitr, bool xupdate_extrema)
364 {
365  // Preconditions:
366 
367  require(allocated_iterator(xitr));
368  require(!xitr.is_done());
369  require(contains(xitr.pod()));
370 
371  // Body:
372 
373  define_old_variable(size_type old_ct = _ct);
374  define_old_variable(pod_type old_begin = _begin);
375  define_old_variable(pod_type old_end = _end);
376  define_old_variable(pod_type old_itr_id = xitr.pod());
377  define_old_variable(pod_type old_itr_hub_id = xitr.hub_pod());
378 
379  map_rep_remove_entry(xitr);
380 
381  // Update the count.
382 
383  --_ct;
384 
385  if(xupdate_extrema)
386  {
387  // Update the extrema.
388 
390  }
391 
392  // Postconditions:
393 
394  // ensure(!contains(old_itr_id)); Not true for list_cover_set_iterator
395  ensure(!contains_hub(old_itr_hub_id));
396  ensure(ct() == old_ct - 1);
397  ensure(xupdate_extrema || begin() == old_begin);
398  ensure(xupdate_extrema || end() == old_end);
399  ensure(xupdate_extrema && is_empty() ? !is_valid(begin()) : true);
400  ensure(xupdate_extrema && is_empty() ? !is_valid(end()) : true);
401  ensure(xupdate_extrema && !is_empty() ? begin() >= old_begin : true);
402  ensure(xupdate_extrema && !is_empty() ? end() <= old_end : true);
403  // ensure(xitr.is_done() || xitr.pod() > old_itr_pod); Not true for list_index_space.
404  ensure(unexecutable("xitr.is_done() || xitr.hub_pod() == old_next_itr_hub_pod"));
405 
406  // Exit:
407 
408  return;
409 }
410 
411 void
414 {
415  // Preconditions:
416 
417  // Body:
418 
419  // Gather the ids.
420 
421  map_rep_gather();
422 
423  // Set the extrema to reflect the gather.
424 
425  if(_ct > 0)
426  {
427  _begin = 0;
428  _end = _ct;
429  }
430  else
431  {
433  }
434 
435  // Postconditions:
436 
437  ensure(invariant());
438  ensure(is_gathered());
439 
440  // Exit:
441 
442  return;
443 }
444 
445 void
448 {
449  // Preconditions:
450 
451  // Body:
452 
453  is_abstract();
454 
455  // Postconditions:
456 
457  // Exit
458 
459  return;
460 }
461 
462 void
464 reserve(size_type xcapacity)
465 {
466  // Preconditions:
467 
468  // Body:
469 
470  is_abstract();
471 
472  // Postconditions:
473 
474  ensure(invariant());
475  ensure(capacity() >= xcapacity);
476 
477  // Exit:
478 
479  return;
480 }
481 
484 capacity() const
485 {
486  // Preconditions:
487 
488  // Body:
489 
490  size_type result = 0; // Just to silence compiler warnings.
491 
492  is_abstract();
493 
494  // Postconditions:
495 
496  ensure(is_basic_query);
497 
498  // Exit:
499 
500  return result;
501 }
502 
503 
504 void
507 {
508  // Preconditions:
509 
510  // Body:
511 
512  map_rep_clear();
513 
514  _ct = 0;
516 
517  // Postconditions:
518 
519  ensure(invariant());
520  ensure(is_empty());
521 
522  // Exit:
523 
524  return;
525 }
526 
527 
528 // PROTECTED MEMBER FUNCTIONS
529 
530 void
533 {
534  // Preconditions:
535 
536  // Body:
537 
538  // Default is update_extrema;
539  // descendants may provide optimized implementations.
540 
541  update_extrema();
542 
543  // Postconditions:
544 
545  // Exit
546 
547  return;
548 }
549 
550 void
553 {
554  // Preconditions:
555 
556  // Body:
557 
558  if(_ct > 1)
559  {
560  // Check to see if xid changes the extrema.
561 
562  if(xid < _begin)
563  {
564  _begin = xid;
565  }
566 
567  if(xid >= _end)
568  {
569  _end = xid + 1;
570  }
571  }
572  else if(_ct == 1)
573  {
574  // First id added.
575 
576  _begin = xid;
577  _end = xid + 1;
578  }
579  else
580  {
581  // The map is empty, invalid the extrema.
582 
583  assertion(is_empty());
584 
587  }
588 
589  // Postconditions:
590 
591  // Exit:
592 
593  return;
594 }
595 
596 // PRIVATE MEMBER FUNCTIONS
597 
598 
599 // ===========================================================
600 // MAP REPRESENTATION FACET
601 // ===========================================================
602 
603 // PUBLIC MEMBER FUNCTIONS
604 
605 // PROTECTED MEMBER FUNCTIONS
606 
607 void
610 {
611  // Preconditions:
612 
613  require(!contains_hub(xrange_id));
614 
615  // Body:
616 
617  define_old_variable(pod_type old_next_id = next_id());
618 
619  is_abstract();
620 
621  // Postconditions:
622 
623  // Not finished pushing back; do not ensure invariant.
624 
625  ensure(contains(old_next_id, xrange_id));
626 
627  // Exit
628 
629  return;
630 }
631 
632 void
635 {
636  // Preconditions:
637 
638  require(allocated_iterator(xitr));
639  require(!contains_hub(xrange_id));
640 
641  // Body:
642 
643  define_old_variable(pod_type old_itr_pod = xitr.pod());
644  define_old_variable(pod_type old_itr_hub_pod = xitr.hub_pod());
645 
646  is_abstract();
647 
648  // Postconditions:
649 
650  // Not finished inserting entry, do not ensure invariant.
651 
652  ensure(contains(old_itr_pod, xrange_id));
653  ensure(xitr.pod() == old_itr_pod+1);
654  ensure(xitr.hub_pod() == old_itr_hub_pod);
655 
656  // Exit:
657 
658  return;
659 }
660 
663 map_rep_remove_entry(pod_type xid, bool xis_range_id)
664 {
665  // Preconditions:
666 
667  define_old_variable(pod_type old_pod = xis_range_id ? pod(xid) : xid);
668  define_old_variable(pod_type old_hub_pod = xis_range_id ? xid : hub_pod(xid));
669  define_old_variable(bool old_contains_entry = xis_range_id ? contains_hub(xid) : contains(xid));
670 
671  // Body:
672 
673  size_type result = 0;
674 
675  is_abstract();
676 
677  // Postconditions:
678 
679  // Not finished removing entry; do not ensure invariant.
680 
681  // ensure(xis_range_id ? !contains_hub(xid) : !contains(xid));
682  ensure(!old_contains_entry || !contains(old_pod, old_hub_pod));
683  ensure((result == 0) || (result == 1));
684 
685  // Exit
686 
687  return result;
688 }
689 
690 void
693 {
694  // Preconditions:
695 
696  require(allocated_iterator(xitr));
697  require(!xitr.is_done());
698  require(contains(xitr.pod()));
699 
700  // Body:
701 
702  define_old_variable(pod_type old_itr_id = xitr.pod());
703  define_old_variable(pod_type old_itr_hub_id = xitr.hub_pod());
704 
705  is_abstract();
706 
707  // Postconditions:
708 
709  ensure(!contains(old_itr_id));
710  ensure(!contains(old_itr_hub_id));
711  ensure(xitr.is_done() || xitr.pod() > old_itr_id);
712 
713  // Exit:
714 
715  return;
716 }
717 
718 void
721 {
722  // Preconditions:
723 
724  // Body:
725 
726  is_abstract();
727 
728  // Postconditions:
729 
730  // Not finished clearing; do not ensure invariant.
731  // Map rep is empty, but _ct not reset, so can't ensure is_empty.
732 
733  ensure(unexecutable("map rep is empty"));
734 
735  // Exit:
736 
737  return;
738 }
739 
740 void
743 {
744  // Preconditions:
745 
746  // Body:
747 
748  is_abstract();
749 
750  // Postconditions:
751 
752  ensure(unexecutable("map rep is gathered"));
753 
754  // Exit:
755 
756  return;
757 }
758 
759 // PRIVATE MEMBER FUNCTIONS
760 
761 
762 // ===========================================================
763 // EXPLICIT_INDEX_SPACE_STATE FACET
764 // ===========================================================
765 
766 // PUBLIC MEMBER FUNCTIONS
767 
768 bool
771 {
772  // Preconditions:
773 
774  require(is_ancestor_of(&xother));
775 
776  // Body:
777 
779  dynamic_cast<const gathered_insertion_index_space_state&>(xother);
780 
781  bool result = explicit_index_space_state::operator==(xother);
782 
783  // Postconditions:
784 
785  // Exit
786 
787  return result;
788 }
789 
790 // PROTECTED MEMBER FUNCTIONS
791 
795 {
796  // Preconditions:
797 
798  require(is_ancestor_of(&xother));
799 
800  // Body:
801 
802  (void) explicit_index_space_state::operator=(xother);
803 
804  // Postconditions:
805 
806  ensure(invariant());
807  ensure((*this) == xother);
808 
809  // Exit
810 
811  return *this;
812 }
813 
814 // PRIVATE MEMBER FUNCTIONS
815 
816 
817 // ===========================================================
818 // INDEX SPACE FACET
819 // ===========================================================
820 
821 // PUBLIC MEMBER FUNCTIONS
822 
823 void
825 put_is_persistent(bool xis_persistent)
826 {
827  // Preconditions:
828 
829  // Body:
830 
831  _is_persistent = xis_persistent;
832 
833  // Postconditions:
834 
835  ensure(is_persistent() == xis_persistent);
836 
837  // Exit:
838 
839  return;
840 }
841 
842 // PROTECTED MEMBER FUNCTIONS
843 
844 // PRIVATE MEMBER FUNCTIONS
845 
846 
847 // ===========================================================
848 // FACTORY FACET
849 // ===========================================================
850 
851 // PUBLIC MEMBER FUNCTIONS
852 
853 const std::string&
855 class_name() const
856 {
857  static const std::string result("gathered_insertion_index_space_state");
858  return result;
859 }
860 
861 // PROTECTED MEMBER FUNCTIONS
862 
863 // PRIVATE MEMBER FUNCTIONS
864 
865 
866 // ===========================================================
867 // ANY FACET
868 // ===========================================================
869 
870 // PUBLIC MEMBER FUNCTIONS
871 
872 bool
874 is_ancestor_of(const any *other) const
875 {
876  // Preconditions:
877 
878  require(other != 0);
879 
880  // Body:
881 
882  // True if other conforms to this
883 
884  bool result = dynamic_cast<const gathered_insertion_index_space_state*>(other) != 0;
885 
886  // Postconditions:
887 
888  // Exit:
889 
890  return result;
891 }
892 
893 bool
895 invariant() const
896 {
897  bool result = true;
898 
899  if(invariant_check())
900  {
901  // Prevent recursive calls to invariant
902 
904 
905  // Must satisfy base class invariant
906 
908 
909  // Invariances for this class:
910 
911  // Finished, turn invariant checking back on.
912 
914  }
915 
916  // Exit:
917 
918  return result;
919 }
920 
921 // PROTECTED MEMBER FUNCTIONS
922 
923 // PRIVATE MEMBER FUNCTIONS
924 
925 
926 
927 // ===========================================================
928 // NON-MEMBER FUNCTIONS
929 // ===========================================================
930 
931 size_t
932 sheaf::
933 deep_size(const gathered_insertion_index_space_state& xn, bool xinclude_shallow)
934 {
935  // Preconditions:
936 
937  // Body:
938 
939  size_t result = xinclude_shallow ? sizeof(xn) : 0;
940 
941  // Add any contributions from the parent class.
942 
943  const explicit_index_space_state& ixn = static_cast<const explicit_index_space_state&>(xn);
944  result += deep_size(ixn, false);
945 
946  // Postconditions:
947 
948  ensure(result >= 0);
949 
950  // Exit
951 
952  return result;
953 }
virtual bool allocated_iterator(const index_space_iterator &xitr) const =0
True if and only if id space iterator xitr was allocated by the iterator pool.
bool is_persistent() const
True if this id space should be written to disk.
bool contains_hub(pod_type xid) const
True if this space contains an id equivalent to xid in the unglued hub id space. synonym for contains...
virtual void map_rep_gather()=0
Gathers the map representation into an interval.
virtual gathered_insertion_index_space_state & operator=(const explicit_index_space_state &xother)
Assignment operator.
size_type ct() const
The number of members.
bool in_scope() const
True if and only if scope() contains an entry for pod().
Definition: scoped_index.h:584
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
Definition: scoped_index.h:672
An abstract iterator over the ids of an id space.
void push_back(const scoped_index &xhub_id)
Make the next id in this space equivalent to xhub_id in the hub id space. synonym for push_back(xhub_...
size_type remove(const scoped_index &xid, bool update_extrema)
Removes the equivalence associated with xid.hub_pod(). synonym for remove_hub(xid.hub_pod(), xupdate_extrema). Returns the number of entries actually removed, either 0 or 1.
pod_type end() const
Ending id of this space.
virtual void reserve(size_type xcapacity)=0
Reserve enough memory for xcapacity number of ids.
pod_type pod() const
The current id in the iteration.
virtual size_type capacity() const =0
The number of ids reserved in memory.
virtual size_type deep_size(bool xinclude_shallow) const
The deep size of this.
virtual bool operator==(const explicit_index_space_state &xother) const
True if this is equivalent to xother.
virtual bool operator==(const explicit_index_space_state &xother) const
True if this is equivalent to xother.
bool is_gathered() const
True if begin() == 0 and end() == ct().
void put_is_persistent(bool xis_persistent)
Set if this id space should be written to disk.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
virtual size_type map_rep_remove_entry(pod_type xid, bool xis_range_id)=0
Removes the entry containing range id xid (xis_range_id true) or domain id xid (xis_range_id false) f...
pod_type _end
Ending id of this space.
Abstract base class with useful features for all objects.
Definition: any.h:39
virtual void map_rep_push(index_space_iterator &xitr, pod_type xrange_id)=0
Inserts entry (xitr.pod(), xrange_id) into the map representation. Increments all domain ids greater ...
virtual pod_type pod(pod_type xid) const =0
The pod index in this space equivalent to xid in the unglued hub id space.
bool is_done() const
True if iteration is finished.
An immutable abstract state for a space of alternate integer identifiers (aliases) for a subset of th...
pod_type begin() const
Beginning id of this space.
bool is_scoped() const
True if and only if scope() is attached.
Definition: scoped_index.h:592
void push(index_space_iterator &xitr, const scoped_index &xhub_id)
Makes id xitr.id() in this id space equivalent to xhub_id in the hub id space. Increments all ids gre...
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
void invalidate_extrema()
Invalidate the extrema.
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 hub_index_space_handle & hub_id_space() const
The hub id space.
virtual void map_rep_push_back(pod_type xrange_id)=0
Inserts entry (next_id(), xrange_id) into the map representation.
virtual void update_extrema_after_remove()
Update the id extrema after a remove operation.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
Definition: any.h:97
void gather()
Gathers this id space into a 0-based, contiguous interval.
virtual void map_rep_clear()=0
Removes all entrires from the map representation.
size_type _ct
The number of members.
bool invariant_check() const
True if invariant checking is enabled.
Definition: any.h:79
virtual bool contains(pod_type xid) const =0
True if this space contains id xid.
pod_index_type pod_type
The "plain old data" index type for this.
virtual const std::string & class_name() const
The name of this class.
virtual bool invariant() const
Class invariant.
bool is_empty() const
True if there are no ids in the space.
bool _is_persistent
True if this id space should be written to disk.
An implementation of class explicit_index_space_state that supports gathered insertion of new members...
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
Beginning id of this space.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
Definition: pod_types.cc:31
pod_type next_id() const
The id inserted by the next call to push_back.
void enable_invariant_check() const
Enable invariant checking.
Definition: any.h:87
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 remove_hub(pod_type xhub_id, bool update_extrema)
Removes the equivalence associated with hub id xhub_id. Returns the number of entries actually remove...
pod_type hub_pod() const
The current unglued hub id in the iteration. synonym for unglued_hub_pod().
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710