SheafSystem  0.0.0.0
scoped_index.h
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 #ifndef SCOPED_INDEX_H
22 #define SCOPED_INDEX_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef ASSERT_CONTRACT_H
29 #include "SheafSystem/assert_contract.h"
30 #endif
31 
32 #ifndef ERROR_MESSAGE_H
33 #include "SheafSystem/error_message.h"
34 #endif
35 
36 #ifndef HUB_INDEX_SPACE_HANDLE_H
37 #include "SheafSystem/hub_index_space_handle.h"
38 #endif
39 
40 #ifndef INDEX_SPACE_FAMILY_H
41 #include "SheafSystem/index_space_family.h"
42 #endif
43 
44 #ifndef INDEX_TRAITS_H
45 #include "SheafSystem/index_traits.h"
46 #endif
47 
48 #ifndef NAMESPACE_SCHEMA_MEMBER_INDEX_H
49 #include "SheafSystem/namespace_schema_member_index.h"
50 #endif
51 
52 #ifndef NAMESPACE_MEMBER_INDEX_H
53 #include "SheafSystem/namespace_member_index.h"
54 #endif
55 
56 #ifndef PRIMITIVE_ATTRIBUTES_H
57 #include "SheafSystem/primitive_attributes.h"
58 #endif
59 
60 #ifndef PRIMITIVES_SCHEMA_MEMBER_INDEX_H
61 #include "SheafSystem/primitives_schema_member_index.h"
62 #endif
63 
64 #ifndef STANDARD_DOF_TUPLE_INDEX_H
65 #include "SheafSystem/standard_dof_tuple_index.h"
66 #endif
67 
68 #ifndef STANDARD_MEMBER_INDEX_H
69 #include "SheafSystem/standard_member_index.h"
70 #endif
71 
72 #ifndef STANDARD_SUBPOSET_INDEX_H
73 #include "SheafSystem/standard_subposet_index.h"
74 #endif
75 
76 #ifndef STANDARD_VERSION_INDEX_H
77 #include "SheafSystem/standard_version_index.h"
78 #endif
79 
80 #ifndef STD_IOSTREAM_H
81 #include "SheafSystem/std_iostream.h"
82 #endif
83 
84 #ifndef STD_SET_H
85 #include "SheafSystem/std_set.h"
86 #endif
87 
88 #ifndef STD_UNORDERED_MAP_H
89 #include "SheafSystem/std_unordered_map.h"
90 #endif
91 
92 #ifndef STD_LIMITS_H
93 #include "SheafSystem/std_limits.h"
94 #endif
95 
96 namespace sheaf
97 {
98 
99 class poset_state_handle;
100 
107 struct SHEAF_DLL_SPEC scoped_index_hub_pod
108 {
109  pod_index_type pod;
110 };
111 
112 
116 class SHEAF_DLL_SPEC scoped_index
117 {
118  // ===========================================================
120  // ===========================================================
122 
123 public:
124 
129 
134  : _id_spaces(0),
135  _scope_id(invalid_pod()),
136  _pod(invalid_pod())
137  {
138  // Preconditions:
139 
140  // Body:
141 
142  // Postconditions:
143 
144  ensure(invariant());
145  ensure(!is_scoped());
146  ensure(!is_valid());
147 
148  // Exit:
149 
150  return;
151  };
152 
157  : _id_spaces(&xid_space.id_spaces()),
158  _scope_id(xid_space.index()),
159  _pod(invalid_pod())
160  {
161  // Preconditions:
162 
163  require(xid_space.is_attached());
164 
165  // Body:
166 
167  // Postconditions:
168 
169  ensure(invariant());
170  ensure(is_scoped());
171  ensure(same_scope(xid_space));
172  ensure(!is_valid());
173 
174  // Exit:
175 
176  return;
177  };
178 
182  scoped_index(const index_space_handle& xid_space, pod_type xpod)
183  : _id_spaces(&xid_space.id_spaces()),
184  _scope_id(xid_space.index()),
185  _pod(xpod)
186  {
187  // Preconditions:
188 
189  require(xid_space.is_attached());
190 
191  // Body:
192 
193  // Postconditions:
194 
195  ensure(invariant());
196  ensure(is_scoped());
197  ensure(same_scope(xid_space));
198  ensure(pod() == xpod);
199 
200  // Exit:
201 
202  return;
203  };
204 
208  scoped_index(const index_space_handle& xid_space, const scoped_index& xother)
209  : _id_spaces(&xid_space.id_spaces()),
210  _scope_id(xid_space.index()),
211  _pod(xid_space.pod(xother))
212  {
213  // Preconditions:
214 
215  require(xid_space.is_attached());
216  require(xother.same_id_space_family(xid_space));
217 
218  // Body:
219 
220  // Postconditions:
221 
222  ensure(invariant());
223  ensure(is_scoped());
224  ensure(same_scope(xid_space));
225  ensure( !is_valid() || (*this) ==~ xother);
226 
227  // Exit:
228 
229  return;
230  };
231 
235  scoped_index(const scoped_index& xother)
236  : _id_spaces(0),
237  _scope_id(invalid_pod())
238  {
239  // Preconditions:
240 
241  // Body:
242 
243  (*this) = xother;
244 
245  // Postconditions:
246 
247  ensure(invariant());
248  ensure((*this).is_identical_to(xother));
249 
250  // Exit:
251 
252  return;
253  };
254 
259  scoped_index(const poset_state_handle& xhost, const std::string& xname);
260 
265  scoped_index(pod_type xpod, const poset_state_handle& xhost, const std::string& xname);
266 
271  scoped_index(const scoped_index& xother, const poset_state_handle& xhost, const std::string& xname);
272 
278  {
279  // Preconditions:
280 
281  // Body:
282 
283  // Postconditions:
284 
285  // Exit:
286 
287  return;
288  };
289 
294  {
295  // Preconditions:
296 
297  // Body:
298 
299  if(this != &xother)
300  {
301  if(xother._id_spaces != 0)
302  {
303  // xother is scoped, clone the scope.
304 
305  _id_spaces = xother._id_spaces;
306  _scope_id = xother._scope_id;
307  }
308  else
309  {
310  // xother is not scoped.
311 
312  _id_spaces = 0;
313  _scope_id = invalid_pod();
314  }
315 
316  _pod = xother._pod;
317  }
318 
319  // Postconditions:
320 
321  ensure(invariant());
322  ensure((*this).is_identical_to(xother));
323 
324  // Exit:
325 
326  return *this;
327  };
328 
332  void put(const index_space_handle& xid_space, pod_type xpod)
333  {
334  // Preconditions:
335 
336  require(xid_space.is_attached());
337 
338  // Body:
339 
340  _id_spaces = &xid_space.id_spaces();
341  _scope_id = xid_space.index();
342  _pod = xpod;
343 
344  // Postconditions:
345 
346  ensure(invariant());
347  ensure(pod() == xpod);
348  ensure(same_scope(xid_space));
349 
350  // Exit:
351 
352  return;
353  };
354 
359  {
360  // Preconditions:
361 
362  require(is_scoped());
363 
364  // Body:
365 
366  scoped_index result(*this);
367  result.hub_scope();
368 
369  // Postconditions:
370 
371  ensure(result.is_hub_scope());
372 
373  // Exit:
374 
375  return result;
376  };
377 
381  void hub_scope()
382  {
383  // Preconditions:
384 
385  require(is_scoped());
386 
387  // Body:
388 
389  if(!is_hub_scope())
390  {
391  // Map the pod to the hub id space.
392 
393  _pod = _id_spaces->hub_pod(_scope_id, _pod);
394 
395  // Set the current scope to the hub id space.
396 
397  _scope_id = _id_spaces->hub_id_space().index();
398  }
399  else
400  {
401  // Already in the hub id space; do nothing.
402  }
403 
404  // Postconditions:
405 
406  ensure(is_hub_scope());
407 
408  // Exit:
409 
410  return;
411  };
412 
413 
417  bool invariant() const
418  {
420 
421  return true;
422  };
423 
424 protected:
425 
426 private:
427 
429 
430 
431  // ===========================================================
433  // ===========================================================
435 
436 public:
437 
441  void put_scope(const index_space_handle& xid_space)
442  {
443  // Preconditions:
444 
445  require(xid_space.is_attached());
446 
447  // Body:
448 
449  _id_spaces = &xid_space.id_spaces();
450  _scope_id = xid_space.index();
451 
452  // Postconditions:
453 
454  ensure(same_scope(xid_space));
455 
456  // Exit:
457 
458  return;
459  };
460 
464  bool same_scope(const scoped_index& xother) const
465  {
466  return is_scoped() && (_id_spaces == xother._id_spaces) && (_scope_id == xother._scope_id);
467  };
468 
472  bool same_scope(const index_space_handle& xid_space) const
473  {
474  return is_scoped() && (_id_spaces == &xid_space.id_spaces()) && (_scope_id == xid_space.index());
475  };
476 
480  bool same_id_space_family(const scoped_index& xother) const
481  {
482  return is_scoped() && xother.is_scoped() &&
483  (_id_spaces == xother._id_spaces);
484  };
485 
489  bool same_id_space_family(const index_space_handle& xid_space) const
490  {
491  return is_scoped() && (xid_space.is_attached()) &&
492  (_id_spaces == &(xid_space.id_spaces()));
493  };
494 
499  {
500  // Preconditions:
501 
502  require(is_scoped());
503 
504  // Body:
505 
506  // Postconditions:
507 
508  // Exit:
509 
510  return *_id_spaces;
511  };
512 
516  pod_type scope_id() const
517  {
518  // Preconditions:
519 
520  require(is_scoped());
521 
522  // Body:
523 
524  // Postconditions:
525 
526  // Exit:
527 
528  return _scope_id;
529  };
530 
535  {
536  // Preconditions:
537 
538  require(is_scoped());
539 
540  // Body:
541 
542  // Postconditions:
543 
544  // Exit:
545 
546  return _id_spaces->get_id_space(_scope_id);
547  };
548 
552  void release_scope(index_space_handle& xid_space) const
553  {
554  // Preconditions:
555 
556  require(is_scoped());
557  require(same_scope(xid_space));
558 
559  // Body:
560 
561  _id_spaces->release_id_space(xid_space);
562 
563  // Postconditions:
564 
565  ensure(!xid_space.is_attached());
566 
567  // Exit:
568 
569  return;
570  };
571 
575  bool is_hub_scope() const
576  {
577  return is_scoped() &&
578  (_id_spaces->hub_id_space().index() == _scope_id);
579  };
580 
584  bool in_scope() const
585  {
586  return is_scoped() && _id_spaces->contains(_scope_id, _pod);
587  };
588 
592  bool is_scoped() const
593  {
594  return (_id_spaces != 0) && _id_spaces->contains(_scope_id);
595  };
596 
602  {
603  // Preconditions:
604 
605  require(is_scoped());
606  require(xother.is_scoped());
607 
608  // Body:
609 
610  _pod = _id_spaces->pod(_scope_id, xother.hub_pod());
611 
612  // Postconditions:
613 
614  ensure( !is_valid() || (*this) ==~ xother);
615 
616  // Exit:
617 
618  return *this;
619  };
620 
626  {
627  // Preconditions:
628 
629  require(is_scoped());
630  require(xother.is_scoped());
631 
632  // Body:
633 
634  xother._pod = xother._id_spaces->pod(xother._scope_id, this->hub_pod());
635 
636  // Postconditions:
637 
638  ensure( !xother.is_valid() || (*this) ==~ xother);
639 
640  // Exit:
641 
642  return xother;
643  };
644 
645 protected:
646 
647 private:
648 
652  const index_space_family* _id_spaces;
653 
657  pod_type _scope_id;
658 
660 
661  // ===========================================================
663  // ===========================================================
665 
666 public:
667 
672  const pod_type& pod() const
673  {
674  return _pod;
675  };
676 
680  void put_pod(pod_type xpod)
681  {
682  // Preconditions:
683 
684  require(is_scoped());
685 
686  // Body:
687 
688  _pod = xpod;
689 
690  // Postconditions:
691 
692  ensure(pod() == xpod);
693 
694  // Exit:
695 
696  return;
697  };
698 
702  static pod_type invalid_pod()
703  {
704  return invalid_pod_index();
705  };
706 
710  pod_type hub_pod() const
711  {
712  // Preconditions:
713 
714  require(is_scoped());
715 
716  // Body:
717 
718  return _id_spaces->unglued_hub_pod(_scope_id, _pod);
719  };
720 
724  pod_type unglued_hub_pod() const
725  {
726  // Preconditions:
727 
728  require(is_scoped());
729 
730  // Body:
731 
732  return _id_spaces->unglued_hub_pod(_scope_id, _pod);
733  };
734 
738  pod_type glued_hub_pod() const
739  {
740  // Preconditions:
741 
742  require(is_scoped());
743 
744  // Body:
745 
746  return _id_spaces->glued_hub_pod(_scope_id, _pod);
747  };
748 
754  {
755  scoped_index_hub_pod result;
756  result.pod = hub_pod();
757  return result;
758  };
759 
763  bool operator==(scoped_index_hub_pod xother) const
764  {
765  return hub_pod() == xother.pod;
766  };
767 
771  bool operator!=(scoped_index_hub_pod xother) const
772  {
773  return hub_pod() != xother.pod;
774  };
775 
779  bool operator<(scoped_index_hub_pod xother) const
780  {
781  return hub_pod() < xother.pod;
782  };
783 
788  bool operator<=(scoped_index_hub_pod xother) const
789  {
790  return hub_pod() <= xother.pod;
791  };
792 
796  bool operator>(scoped_index_hub_pod xother) const
797  {
798  return hub_pod() > xother.pod;
799  };
800 
805  bool operator>=(scoped_index_hub_pod xother) const
806  {
807  return hub_pod() >= xother.pod;
808  };
809 
810 protected:
811 
812 private:
813 
817  pod_type _pod;
818 
820 
821 
822  // ===========================================================
824  // ===========================================================
826 
827 public:
828 
832  bool is_valid() const
833  {
834  bool result;
835 
836  // Preconditions:
837 
838  // Body:
839 
840  result = (_pod != invalid_pod());
841 
842  // Postconditions:
843 
844  // Exit:
845 
846  return result;
847  };
848 
852  void invalidate()
853  {
854 
855  // Preconditions:
856 
857  // Body:
858 
859  _pod = invalid_pod();
860 
861  // Postconditions:
862 
863  ensure(!is_valid());
864 
865  // Exit:
866  };
867 
871  static const scoped_index& INVALID()
872  {
873  // Preconditions:
874 
875  // Body:
876 
877  // Default constructor ensures invalid.
878 
879  static const scoped_index result;
880 
881  // Postconditions:
882 
883  ensure(!result.is_valid());
884 
885  // Exit:
886 
887  return result;
888  };
889 
890 protected:
891 
892 private:
893 
895 
896 
897  // ===========================================================
899  // ===========================================================
901 
902 public:
903 
908  bool is_identical_to(const scoped_index& xother) const
909  {
910  bool result;
911 
912  // Preconditions:
913 
914  // Body:
915 
916  result =
917  (_pod == xother._pod) &&
918  (_id_spaces == xother._id_spaces) &&
919  (_scope_id == xother._scope_id);
920 
921  // Postconditions:
922 
923  // Exit:
924 
925  return result;
926  };
927 
932  bool is_equivalent_to(const scoped_index& xother) const
933  {
934  bool result;
935 
936  // Preconditions:
937 
938  require(is_scoped());
939  require(xother.is_scoped());
940 
941  // Body:
942 
946 
947  result = (hub_pod() == xother.hub_pod());
948 
949  // Postconditions:
950 
951  ensure(is_basic_query);
952 
953  // Exit:
954 
955  return result;
956  };
957 
962  bool operator==(const scoped_index& xother) const
963  {
964  bool result;
965 
966  // Preconditions:
967 
968  // Body:
969 
970  result = is_identical_to(xother);
971 
972  // Postconditions:
973 
974  ensure(is_basic_query);
975 
976  // Exit:
977 
978  return result;
979  };
980 
984  bool operator!=(const scoped_index& xother) const
985  {
986  bool result;
987 
988  // Preconditions:
989 
990  // Body:
991 
992  result = !is_identical_to(xother);
993 
994  // Postconditions:
995 
996  // Exit:
997 
998  return result;
999  };
1000 
1004  bool operator<(const scoped_index& xother) const
1005  {
1006  // Preconditions:
1007 
1008  require(same_scope(xother));
1009 
1010  // Body:
1011 
1012  bool result = (_pod < xother._pod);
1013 
1014  // Postconditions:
1015 
1016  ensure(is_basic_query);
1017 
1018  // Exit:
1019 
1020  return result;
1021  };
1022 
1026  bool operator<=(const scoped_index& xother) const
1027  {
1028  // Preconditions:
1029 
1030  require(same_scope(xother));
1031 
1032  // Body:
1033 
1034  bool result = (_pod <= xother._pod);
1035 
1036  // Postconditions:
1037 
1038  ensure(is_basic_query);
1039 
1040  // Exit:
1041 
1042  return result;
1043  };
1044 
1048  bool operator>(const scoped_index& xother) const
1049  {
1050  // Preconditions:
1051 
1052  require(same_scope(xother));
1053 
1054  // Body:
1055 
1056  bool result = (_pod > xother._pod);
1057 
1058  // Postconditions:
1059 
1060  ensure(is_basic_query);
1061 
1062  // Exit:
1063 
1064  return result;
1065  };
1066 
1070  bool operator>=(const scoped_index& xother) const
1071  {
1072  // Preconditions:
1073 
1074  require(same_scope(xother));
1075 
1076  // Body:
1077 
1078  bool result = (_pod >= xother._pod);
1079 
1080  // Postconditions:
1081 
1082  ensure(is_basic_query);
1083 
1084  // Exit:
1085 
1086  return result;
1087  };
1088 
1093  bool in_range(const scoped_index& xbegin, const scoped_index& xend) const
1094  {
1095  // Preconditions:
1096 
1097  require(xbegin.same_scope(xend));
1098  require(same_id_space_family(xbegin));
1099 
1100  // Body:
1101 
1102  pod_index_type lpod = xbegin._id_spaces->pod(xbegin._scope_id, this->hub_pod());
1103 
1104  bool result = ((xbegin.pod() <= lpod) && (xend.pod() > lpod));
1105 
1106  // Postconditions:
1107 
1108  // Exit:
1109 
1110  return result;
1111  };
1112 
1113 protected:
1114 
1115 private:
1116 
1118 
1119 
1120  // ===========================================================
1122  // ===========================================================
1124 
1125 public:
1126 
1130  scoped_index operator+(const scoped_index& xother) const
1131  {
1132  // Preconditions:
1133 
1134  // Body:
1135 
1136  scoped_index result(*this);
1137  result += xother;
1138 
1139  // Postconditions:
1140 
1141  ensure(result.same_scope(*this));
1142  ensure(result.pod() == (pod() + id_spaces().pod(scope_id(), xother)));
1143 
1144  // Exit:
1145 
1146  return result;
1147  };
1148 
1149 
1154  {
1155  // Preconditions:
1156 
1157  require(is_scoped());
1158 
1159  // Body:
1160 
1161  define_old_variable(pod_type old_pod = pod());
1162  define_old_variable(scoped_index& result = *this);
1163 
1164  _pod += _id_spaces->pod(_scope_id, xother.hub_pod());
1165 
1166  // Postconditions:
1167 
1168  ensure(pod() == (old_pod + id_spaces().pod(scope_id(), xother)));
1169  ensure(&result == this);
1170 
1171  // Exit:
1172 
1173  return *this;
1174  };
1175 
1180  {
1181  // Preconditions:
1182 
1183  require(is_valid());
1184 
1185  // Body:
1186 
1187  define_old_variable(pod_type old_pod = pod());
1188  define_old_variable(scoped_index& result = *this);
1189 
1190  ++_pod;
1191 
1192  // Postconditions:
1193 
1194  ensure(pod() == (old_pod + 1));
1195  ensure(&result == this);
1196 
1197  // Exit:
1198 
1199  return *this;
1200  };
1201 
1206  {
1207  // Preconditions:
1208 
1209  require(is_valid());
1210 
1211  // Body:
1212 
1213  define_old_variable(pod_type old_pod = pod());
1214 
1215  scoped_index result(*this);
1216 
1217  ++_pod;
1218 
1219  // Postconditions:
1220 
1221  ensure(pod() == (old_pod + 1));
1222  ensure(result.pod() == old_pod);
1223 
1224 
1225  // Exit:
1226 
1227  return result;
1228  };
1229 
1234  {
1235  scoped_index result;
1236  result._pod = -_pod;
1237  return result;
1238  };
1239 
1243  scoped_index operator-(const scoped_index& xother) const
1244  {
1245  // Preconditions:
1246 
1247  require(is_scoped());
1248 
1249  // Body:
1250 
1251  scoped_index result(*this);
1252  result -= xother;
1253 
1254  // Postconditions:
1255 
1256  ensure(result.pod() == (pod() - id_spaces().pod(scope_id(), xother)));
1257 
1258  // Exit:
1259 
1260  return result;
1261  };
1262 
1263 
1268  {
1269  // Preconditions:
1270 
1271  require(is_scoped());
1272 
1273  // Body:
1274 
1275  define_old_variable(pod_type old_pod = pod());
1276  define_old_variable(scoped_index& result = *this);
1277 
1278  _pod -= _id_spaces->pod(_scope_id, xother.hub_pod());
1279 
1280  // Postconditions:
1281 
1282  ensure(pod() == (old_pod - id_spaces().pod(scope_id(), xother)));
1283  ensure(&result == this);
1284 
1285  // Exit:
1286 
1287  return *this;
1288  };
1289 
1294  {
1295  // Preconditions:
1296 
1297  require(is_valid());
1298 
1299  // Body:
1300 
1301  define_old_variable(pod_type old_pod = pod());
1302  define_old_variable(scoped_index& result = *this);
1303 
1304  --_pod;
1305 
1306  // Postconditions:
1307 
1308  ensure(pod() == (old_pod - 1));
1309  ensure(&result == this);
1310 
1311  // Exit:
1312 
1313  return *this;
1314  };
1315 
1320  {
1321  // Preconditions:
1322 
1323  require(is_valid());
1324 
1325  // Body:
1326 
1327  define_old_variable(pod_type old_pod = pod());
1328 
1329  scoped_index result(*this);
1330 
1331  --_pod;
1332 
1333  // Postconditions:
1334 
1335  ensure(pod() == (old_pod - 1));
1336  ensure(result.pod() == old_pod);
1337 
1338 
1339  // Exit:
1340 
1341  return result;
1342  };
1343 
1347  scoped_index operator*(const scoped_index& xother) const
1348  {
1349  // Preconditions:
1350 
1351  require(is_scoped());
1352 
1353  // Body:
1354 
1355  scoped_index result(*this);
1356  result *= xother;
1357 
1358  // Postconditions:
1359 
1360  ensure(result.pod() == (pod() * id_spaces().pod(scope_id(), xother)));
1361 
1362  // Exit:
1363 
1364  return result;
1365  };
1366 
1367 
1372  {
1373  // Preconditions:
1374 
1375  require(is_scoped());
1376 
1377  // Body:
1378 
1379  define_old_variable(pod_type old_pod = pod());
1380  define_old_variable(scoped_index& result = *this);
1381 
1382  _pod *= _id_spaces->pod(_scope_id, xother.hub_pod());
1383 
1384  // Postconditions:
1385 
1386  ensure(pod() == (old_pod * id_spaces().pod(scope_id(), xother)));
1387  ensure(&result == this);
1388 
1389  // Exit:
1390 
1391  return *this;
1392  };
1393 
1397  scoped_index operator/(const scoped_index& xother) const
1398  {
1399  // Preconditions:
1400 
1401  require(xother.pod() != 0);
1402 
1403  // Body:
1404 
1405  scoped_index result(*this);
1406  result /= xother;
1407 
1408  // Postconditions:
1409 
1410  ensure(result.pod() == (pod() / xother.pod()));
1411 
1412  // Exit:
1413 
1414  return result;
1415  };
1416 
1417 
1422  {
1423  // Preconditions:
1424 
1425  require(is_scoped());
1426  require(id_spaces().pod(scope_id(), xother) != 0);
1427 
1428  // Body:
1429 
1430  define_old_variable(pod_type old_pod = pod());
1431  define_old_variable(scoped_index& result = *this);
1432 
1433  _pod /= _id_spaces->pod(_scope_id, xother.hub_pod());
1434 
1435  // Postconditions:
1436 
1437  ensure(pod() == (old_pod / id_spaces().pod(scope_id(), xother)));
1438  ensure(&result == this);
1439 
1440  // Exit:
1441 
1442  return *this;
1443  };
1444 
1448  scoped_index operator%(const scoped_index& xother) const
1449  {
1450  // Preconditions:
1451 
1452  require(is_scoped());
1453  require(id_spaces().pod(scope_id(), xother) != 0);
1454 
1455  // Body:
1456 
1457  scoped_index result(*this);
1458  result %= xother;
1459 
1460  // Postconditions:
1461 
1462  ensure(result.pod() == (pod() % id_spaces().pod(scope_id(), xother)));
1463 
1464  // Exit:
1465 
1466  return result;
1467  };
1468 
1469 
1474  {
1475 
1476  // Preconditions:
1477 
1478  require(is_scoped());
1479  require(id_spaces().pod(scope_id(), xother) != 0);
1480 
1481  // Body:
1482 
1483  define_old_variable(pod_type old_pod = pod());
1484  define_old_variable(scoped_index& result = *this);
1485 
1486  _pod %= _id_spaces->pod(_scope_id, xother.hub_pod());
1487 
1488  // Postconditions:
1489 
1490  ensure(pod() == (old_pod % id_spaces().pod(scope_id(), xother)));
1491  ensure(&result == this);
1492 
1493  // Exit:
1494 
1495  return *this;
1496  };
1497 
1501  bool is_positive() const
1502  {
1503  return _pod >= 0;
1504  };
1505 
1510  {
1511  return _pod > 0;
1512  };
1513 
1514 protected:
1515 
1516 private:
1517 
1519 
1520  // ===========================================================
1522  // ===========================================================
1524 
1525 public:
1526 
1531  : _id_spaces(&xid_space.id_spaces()),
1532  _scope_id(xid_space.index()),
1533  _pod(x)
1534  {
1535  ensure((x == NOT_A_PRIMITIVE_TYPE) == (!is_valid()));
1536  };
1537 
1542  {
1543  // Preconditions:
1544 
1545  require(is_scoped());
1546 
1547  // Body:
1548 
1549  _pod = x;
1550 
1551  // Postconditions:
1552 
1553  // Exit:
1554 
1555  return *this;
1556  };
1557 
1562  {
1563  return _pod == x;
1564  };
1565 
1570  {
1571  return _pod != x;
1572  };
1573 
1578  {
1579  return _pod < x;
1580  };
1581 
1586  {
1587  return _pod <= x;
1588  };
1589 
1594  {
1595  return _pod > x;
1596  };
1597 
1602  {
1603  return _pod >= x;
1604  };
1605 
1606 protected:
1607 
1608 private:
1609 
1611 
1612 
1613  // ===========================================================
1615  // ===========================================================
1617 
1618 public:
1619 
1624  : _id_spaces(&xid_space.id_spaces()),
1625  _scope_id(xid_space.index()),
1626  _pod(x)
1627  {
1628  ensure((x == NOT_A_STANDARD_MEMBER_INDEX) == (!is_valid()));
1629  };
1630 
1635  {
1636  // Preconditions:
1637 
1638  require(is_scoped());
1639 
1640  // Body:
1641 
1642  _pod = x;
1643 
1644  // Postconditions:
1645 
1646  // Exit:
1647 
1648  return *this;
1649  };
1650 
1655  {
1656  return _pod == x;
1657  };
1658 
1663  {
1664  return _pod != x;
1665  };
1666 
1671  {
1672  return _pod < x;
1673  };
1674 
1679  {
1680  return _pod <= x;
1681  };
1682 
1687  {
1688  return _pod > x;
1689  };
1690 
1695  {
1696  return _pod >= x;
1697  };
1698 
1699 protected:
1700 
1701 private:
1702 
1704 
1705 
1706  // ===========================================================
1708  // ===========================================================
1710 
1711 public:
1712 
1717  : _id_spaces(&xid_space.id_spaces()),
1718  _scope_id(xid_space.index()),
1719  _pod(x)
1720  {
1721  ensure((x == NOT_A_PRIMITIVES_SCHEMA_MEMBER_INDEX) == (!is_valid()));
1722  };
1723 
1728  {
1729  // Preconditions:
1730 
1731  require(is_scoped());
1732 
1733  // Body:
1734 
1735  _pod = x;
1736 
1737  // Postconditions:
1738 
1739  // Exit:
1740 
1741  return *this;
1742  };
1743 
1748  {
1749  return _pod == x;
1750  };
1751 
1756  {
1757  return _pod != x;
1758  };
1759 
1764  {
1765  return _pod < x;
1766  };
1767 
1772  {
1773  return _pod <= x;
1774  };
1775 
1780  {
1781  return _pod > x;
1782  };
1783 
1788  {
1789  return _pod >= x;
1790  };
1791 
1792 protected:
1793 
1794 private:
1795 
1797 
1798 
1799  // ===========================================================
1801  // ===========================================================
1803 
1804 public:
1805 
1810  : _id_spaces(&xid_space.id_spaces()),
1811  _scope_id(xid_space.index()),
1812  _pod(x)
1813  {
1814  ensure((x == NOT_A_NAMESPACE_SCHEMA_MEMBER_INDEX) == (!is_valid()));
1815  };
1816 
1821  {
1822  // Preconditions:
1823 
1824  require(is_scoped());
1825 
1826  // Body:
1827 
1828  _pod = x;
1829 
1830  // Postconditions:
1831 
1832  // Exit:
1833 
1834  return *this;
1835  };
1836 
1841  {
1842  return _pod == x;
1843  };
1844 
1849  {
1850  return _pod != x;
1851  };
1852 
1857  {
1858  return _pod < x;
1859  };
1860 
1865  {
1866  return _pod <= x;
1867  };
1868 
1873  {
1874  return _pod > x;
1875  };
1876 
1881  {
1882  return _pod >= x;
1883  };
1884 
1885 protected:
1886 
1887 private:
1888 
1890 
1891 
1892  // ===========================================================
1894  // ===========================================================
1896 
1897 public:
1898 
1903  : _id_spaces(&xid_space.id_spaces()),
1904  _scope_id(xid_space.index()),
1905  _pod(x)
1906  {
1907  ensure((x == NOT_A_NAMESPACE_MEMBER_INDEX) == (!is_valid()));
1908  };
1909 
1914  {
1915  // Preconditions:
1916 
1917  require(is_scoped());
1918 
1919  // Body:
1920 
1921  _pod = x;
1922 
1923  // Postconditions:
1924 
1925  // Exit:
1926 
1927  return *this;
1928  };
1929 
1934  {
1935  return _pod == x;
1936  };
1937 
1942  {
1943  return _pod != x;
1944  };
1945 
1950  {
1951  return _pod < x;
1952  };
1953 
1958  {
1959  return _pod <= x;
1960  };
1961 
1966  {
1967  return _pod > x;
1968  };
1969 
1974  {
1975  return _pod >= x;
1976  };
1977 
1978 protected:
1979 
1980 private:
1981 
1983 
1984 
1985  // ===========================================================
1987  // ===========================================================
1989 
1990 public:
1991 
1996  : _id_spaces(&xid_space.id_spaces()),
1997  _scope_id(xid_space.index()),
1998  _pod(x)
1999  {
2000  ensure((x == NOT_A_STANDARD_SUBPOSET_INDEX) == (!is_valid()));
2001  };
2002 
2007  {
2008  // Preconditions:
2009 
2010  require(is_scoped());
2011 
2012  // Body:
2013 
2014  _pod = x;
2015 
2016  // Postconditions:
2017 
2018  // Exit:
2019 
2020  return *this;
2021  };
2022 
2027  {
2028  return _pod == x;
2029  };
2030 
2035  {
2036  return _pod != x;
2037  };
2038 
2043  {
2044  return _pod < x;
2045  };
2046 
2051  {
2052  return _pod <= x;
2053  };
2054 
2059  {
2060  return _pod > x;
2061  };
2062 
2067  {
2068  return _pod >= x;
2069  };
2070 
2071 protected:
2072 
2073 private:
2074 
2076 
2077 
2078  // ===========================================================
2080  // ===========================================================
2082 
2083 public:
2084 
2089  : _id_spaces(&xid_space.id_spaces()),
2090  _scope_id(xid_space.index()),
2091  _pod(x)
2092  {
2093  ensure((x == NOT_A_STANDARD_VERSION_INDEX) == (!is_valid()));
2094  };
2095 
2100  {
2101  // Preconditions:
2102 
2103  require(is_scoped());
2104 
2105  // Body:
2106 
2107  _pod = x;
2108 
2109  // Postconditions:
2110 
2111  // Exit:
2112 
2113  return *this;
2114  };
2115 
2120  {
2121  return _pod == x;
2122  };
2123 
2128  {
2129  return _pod != x;
2130  };
2131 
2136  {
2137  return _pod < x;
2138  };
2139 
2144  {
2145  return _pod <= x;
2146  };
2147 
2152  {
2153  return _pod > x;
2154  };
2155 
2160  {
2161  return _pod >= x;
2162  };
2163 
2164 protected:
2165 
2166 private:
2167 
2169 
2170 
2171  // ===========================================================
2173  // ===========================================================
2175 
2176 public:
2177 
2182  : _id_spaces(&xid_space.id_spaces()),
2183  _scope_id(xid_space.index()),
2184  _pod(x)
2185  {
2186  ensure((x == NOT_A_STANDARD_DOF_TUPLE_INDEX) == (!is_valid()));
2187  };
2188 
2193  {
2194  // Preconditions:
2195 
2196  require(is_scoped());
2197 
2198  // Body:
2199 
2200  _pod = x;
2201 
2202  // Postconditions:
2203 
2204  // Exit:
2205 
2206  return *this;
2207  };
2208 
2213  {
2214  return _pod == x;
2215  };
2216 
2221  {
2222  return _pod != x;
2223  };
2224 
2229  {
2230  return _pod < x;
2231  };
2232 
2237  {
2238  return _pod <= x;
2239  };
2240 
2245  {
2246  return _pod > x;
2247  };
2248 
2253  {
2254  return _pod >= x;
2255  };
2256 
2257 protected:
2258 
2259 private:
2260 
2262 
2263 
2264  // ===========================================================
2266  // ===========================================================
2268 
2269 public:
2270 
2274  scoped_index(unsigned char xother, const index_space_handle& xid_space)
2275  : _id_spaces(&xid_space.id_spaces()),
2276  _scope_id(xid_space.index()),
2277  _pod(static_cast<pod_type>(xother))
2278  {
2279  };
2280 
2284  scoped_index& operator=(unsigned char xother)
2285  {
2286  // Preconditions:
2287 
2288  require(is_scoped());
2289 
2290  // Body:
2291 
2292  _pod = static_cast<pod_type>(xother);
2293 
2294  // Postconditions:
2295 
2296  // Exit:
2297 
2298  return *this;
2299  };
2300 
2304  bool operator==(unsigned char xother) const
2305  {
2306  return _pod == static_cast<pod_type>(xother);
2307  };
2308 
2312  bool operator!=(unsigned char xother) const
2313  {
2314  return _pod != static_cast<pod_type>(xother);
2315  };
2316 
2320  bool operator<(unsigned char xother) const
2321  {
2322  return _pod < static_cast<pod_type>(xother);
2323  };
2324 
2328  bool operator<=(unsigned char xother) const
2329  {
2330  return _pod <= static_cast<pod_type>(xother);
2331  };
2332 
2336  bool operator>(unsigned char xother) const
2337  {
2338  return _pod > static_cast<pod_type>(xother);
2339  };
2340 
2344  bool operator>=(unsigned char xother) const
2345  {
2346  return _pod >= static_cast<pod_type>(xother);
2347  };
2348 
2352  scoped_index& operator+=(unsigned char xother)
2353  {
2354  _pod += static_cast<pod_type>(xother);
2355  return *this;
2356  };
2357 
2361  scoped_index operator+(unsigned char xother) const
2362  {
2363  scoped_index result(*this);
2364  return result += xother;
2365  };
2366 
2370  scoped_index& operator-=(unsigned char xother)
2371  {
2372  _pod -= static_cast<pod_type>(xother);
2373  return *this;
2374  };
2375 
2379  scoped_index operator-(unsigned char xother) const
2380  {
2381  scoped_index result(*this);
2382  return result -= xother;
2383  };
2384 
2388  scoped_index& operator*=(unsigned char xother)
2389  {
2390  _pod *= static_cast<pod_type>(xother);
2391  return *this;
2392  };
2393 
2397  scoped_index operator*(unsigned char xother) const
2398  {
2399  scoped_index result(*this);
2400  return result *= xother;
2401  };
2402 
2406  scoped_index& operator/=(unsigned char xother)
2407  {
2408  _pod /= static_cast<pod_type>(xother);
2409  return *this;
2410  };
2411 
2415  scoped_index operator/(unsigned char xother) const
2416  {
2417  scoped_index result(*this);
2418  return result /= xother;
2419  };
2420 
2424  scoped_index& operator%=(unsigned char xother)
2425  {
2426  _pod %= static_cast<pod_type>(xother);
2427  return *this;
2428  };
2429 
2433  scoped_index operator%(unsigned char xother) const
2434  {
2435  scoped_index result(*this);
2436  return result %= xother;
2437  };
2438 
2439 protected:
2440 
2441 private:
2442 
2444 
2445 
2446  // ===========================================================
2448  // ===========================================================
2450 
2451 public:
2452 
2456  scoped_index(unsigned short int xother, const index_space_handle& xid_space)
2457  : _id_spaces(&xid_space.id_spaces()),
2458  _scope_id(xid_space.index()),
2459  _pod(static_cast<pod_type>(xother))
2460  {
2461  };
2462 
2466  scoped_index& operator=(unsigned short int xother)
2467  {
2468  // Preconditions:
2469 
2470  require(is_scoped());
2471 
2472  // Body:
2473 
2474  _pod = static_cast<pod_type>(xother);
2475 
2476  // Postconditions:
2477 
2478  // Exit:
2479 
2480  return *this;
2481  };
2482 
2486  bool operator==(unsigned short int xother) const
2487  {
2488  return _pod == static_cast<pod_type>(xother);
2489  };
2490 
2494  bool operator!=(unsigned short int xother) const
2495  {
2496  return _pod != static_cast<pod_type>(xother);
2497  };
2498 
2502  bool operator<(unsigned short int xother) const
2503  {
2504  return _pod < static_cast<pod_type>(xother);
2505  };
2506 
2510  bool operator<=(unsigned short int xother) const
2511  {
2512  return _pod <= static_cast<pod_type>(xother);
2513  };
2514 
2518  bool operator>(unsigned short int xother) const
2519  {
2520  return _pod > static_cast<pod_type>(xother);
2521  };
2522 
2526  bool operator>=(unsigned short int xother) const
2527  {
2528  return _pod >= static_cast<pod_type>(xother);
2529  };
2530 
2534  scoped_index& operator+=(unsigned short int xother)
2535  {
2536  _pod += static_cast<pod_type>(xother);
2537  return *this;
2538  };
2539 
2543  scoped_index operator+(unsigned short int xother) const
2544  {
2545  scoped_index result(*this);
2546  return result += xother;
2547  };
2548 
2552  scoped_index& operator-=(unsigned short int xother)
2553  {
2554  _pod -= static_cast<pod_type>(xother);
2555  return *this;
2556  };
2557 
2561  scoped_index operator-(unsigned short int xother) const
2562  {
2563  scoped_index result(*this);
2564  return result -= xother;
2565  };
2566 
2570  scoped_index& operator*=(unsigned short int xother)
2571  {
2572  _pod *= static_cast<pod_type>(xother);
2573  return *this;
2574  };
2575 
2579  scoped_index operator*(unsigned short int xother) const
2580  {
2581  scoped_index result(*this);
2582  return result *= xother;
2583  };
2584 
2588  scoped_index& operator/=(unsigned short int xother)
2589  {
2590  _pod /= static_cast<pod_type>(xother);
2591  return *this;
2592  };
2593 
2597  scoped_index operator/(unsigned short int xother) const
2598  {
2599  scoped_index result(*this);
2600  return result /= xother;
2601  };
2602 
2606  scoped_index& operator%=(unsigned short int xother)
2607  {
2608  _pod %= static_cast<pod_type>(xother);
2609  return *this;
2610  };
2611 
2615  scoped_index operator%(unsigned short int xother) const
2616  {
2617  scoped_index result(*this);
2618  return result %= xother;
2619  };
2620 
2621 protected:
2622 
2623 private:
2624 
2626 
2627 
2628  // ===========================================================
2630  // ===========================================================
2632 
2633 public:
2634 
2638  scoped_index(unsigned int xother, const index_space_handle& xid_space)
2639  : _id_spaces(&xid_space.id_spaces()),
2640  _scope_id(xid_space.index()),
2641  _pod(static_cast<pod_type>(xother))
2642  {
2643  };
2644 
2648  scoped_index& operator=(unsigned int xother)
2649  {
2650  // Preconditions:
2651 
2652  require(is_scoped());
2653 
2654  // Body:
2655 
2656  _pod = static_cast<pod_type>(xother);
2657 
2658  // Postconditions:
2659 
2660  // Exit:
2661 
2662  return *this;
2663  };
2664 
2668  bool operator==(unsigned int xother) const
2669  {
2670  return _pod == static_cast<pod_type>(xother);
2671  };
2672 
2676  bool operator!=(unsigned int xother) const
2677  {
2678  return _pod != static_cast<pod_type>(xother);
2679  };
2680 
2684  bool operator<(unsigned int xother) const
2685  {
2686  return _pod < static_cast<pod_type>(xother);
2687  };
2688 
2692  bool operator<=(unsigned int xother) const
2693  {
2694  return _pod <= static_cast<pod_type>(xother);
2695  };
2696 
2700  bool operator>(unsigned int xother) const
2701  {
2702  return _pod > static_cast<pod_type>(xother);
2703  };
2704 
2708  bool operator>=(unsigned int xother) const
2709  {
2710  return _pod >= static_cast<pod_type>(xother);
2711  };
2712 
2716  scoped_index& operator+=(unsigned int xother)
2717  {
2718  _pod += static_cast<pod_type>(xother);
2719  return *this;
2720  };
2721 
2725  scoped_index operator+(unsigned int xother) const
2726  {
2727  scoped_index result(*this);
2728  return result += xother;
2729  };
2730 
2734  scoped_index& operator-=(unsigned int xother)
2735  {
2736  _pod -= static_cast<pod_type>(xother);
2737  return *this;
2738  };
2739 
2743  scoped_index operator-(unsigned int xother) const
2744  {
2745  scoped_index result(*this);
2746  return result -= xother;
2747  };
2748 
2752  scoped_index& operator*=(unsigned int xother)
2753  {
2754  _pod *= static_cast<pod_type>(xother);
2755  return *this;
2756  };
2757 
2761  scoped_index operator*(unsigned int xother) const
2762  {
2763  scoped_index result(*this);
2764  return result *= xother;
2765  };
2766 
2770  scoped_index& operator/=(unsigned int xother)
2771  {
2772  _pod /= static_cast<pod_type>(xother);
2773  return *this;
2774  };
2775 
2779  scoped_index operator/(unsigned int xother) const
2780  {
2781  scoped_index result(*this);
2782  return result /= xother;
2783  };
2784 
2788  scoped_index& operator%=(unsigned int xother)
2789  {
2790  _pod %= static_cast<pod_type>(xother);
2791  return *this;
2792  };
2793 
2797  scoped_index operator%(unsigned int xother) const
2798  {
2799  scoped_index result(*this);
2800  return result %= xother;
2801  };
2802 
2803 protected:
2804 
2805 private:
2806 
2808 
2809 
2810  // ===========================================================
2812  // ===========================================================
2814 
2815 public:
2816 
2820  scoped_index(unsigned long int xother, const index_space_handle& xid_space)
2821  : _id_spaces(&xid_space.id_spaces()),
2822  _scope_id(xid_space.index()),
2823  _pod(static_cast<pod_type>(xother))
2824  {
2825  };
2826 
2830  scoped_index& operator=(unsigned long int xother)
2831  {
2832  // Preconditions:
2833 
2834  require(is_scoped());
2835 
2836  // Body:
2837 
2838  _pod = static_cast<pod_type>(xother);
2839 
2840  // Postconditions:
2841 
2842  // Exit:
2843 
2844  return *this;
2845  };
2846 
2850  bool operator==(unsigned long int xother) const
2851  {
2852  return _pod == static_cast<pod_type>(xother);
2853  };
2854 
2858  bool operator!=(unsigned long int xother) const
2859  {
2860  return _pod != static_cast<pod_type>(xother);
2861  };
2862 
2866  bool operator<(unsigned long int xother) const
2867  {
2868  return _pod < static_cast<pod_type>(xother);
2869  };
2870 
2874  bool operator<=(unsigned long int xother) const
2875  {
2876  return _pod <= static_cast<pod_type>(xother);
2877  };
2878 
2882  bool operator>(unsigned long int xother) const
2883  {
2884  return _pod > static_cast<pod_type>(xother);
2885  };
2886 
2890  bool operator>=(unsigned long int xother) const
2891  {
2892  return _pod >= static_cast<pod_type>(xother);
2893  };
2894 
2898  scoped_index& operator+=(unsigned long int xother)
2899  {
2900  _pod += static_cast<pod_type>(xother);
2901  return *this;
2902  };
2903 
2907  scoped_index operator+(unsigned long int xother) const
2908  {
2909  scoped_index result(*this);
2910  return result += xother;
2911  };
2912 
2916  scoped_index& operator-=(unsigned long int xother)
2917  {
2918  _pod -= static_cast<pod_type>(xother);
2919  return *this;
2920  };
2921 
2925  scoped_index operator-(unsigned long int xother) const
2926  {
2927  scoped_index result(*this);
2928  return result -= xother;
2929  };
2930 
2934  scoped_index& operator*=(unsigned long int xother)
2935  {
2936  _pod *= static_cast<pod_type>(xother);
2937  return *this;
2938  };
2939 
2943  scoped_index operator*(unsigned long int xother) const
2944  {
2945  scoped_index result(*this);
2946  return result *= xother;
2947  };
2948 
2952  scoped_index& operator/=(unsigned long int xother)
2953  {
2954  _pod /= static_cast<pod_type>(xother);
2955  return *this;
2956  };
2957 
2961  scoped_index operator/(unsigned long int xother) const
2962  {
2963  scoped_index result(*this);
2964  return result /= xother;
2965  };
2966 
2970  scoped_index& operator%=(unsigned long int xother)
2971  {
2972  _pod %= static_cast<pod_type>(xother);
2973  return *this;
2974  };
2975 
2979  scoped_index operator%(unsigned long int xother) const
2980  {
2981  scoped_index result(*this);
2982  return result %= xother;
2983  };
2984 
2985 protected:
2986 
2987 private:
2988 
2990 
2991 
2992  // ===========================================================
2994  // ===========================================================
2996 
2997 public:
2998 
3002  scoped_index(signed char xother, const index_space_handle& xid_space)
3003  : _id_spaces(&xid_space.id_spaces()),
3004  _scope_id(xid_space.index()),
3005  _pod(static_cast<pod_type>(xother))
3006  {
3007  };
3008 
3012  scoped_index& operator=(signed char xother)
3013  {
3014  // Preconditions:
3015 
3016  require(is_scoped());
3017 
3018  // Body:
3019 
3020  _pod = static_cast<pod_type>(xother);
3021 
3022  // Postconditions:
3023 
3024  // Exit:
3025 
3026  return *this;
3027  };
3028 
3032  bool operator==(signed char xother) const
3033  {
3034  return _pod == static_cast<pod_type>(xother);
3035  };
3036 
3040  bool operator!=(signed char xother) const
3041  {
3042  return _pod != static_cast<pod_type>(xother);
3043  };
3044 
3048  bool operator<(signed char xother) const
3049  {
3050  return _pod < static_cast<pod_type>(xother);
3051  };
3052 
3056  bool operator<=(signed char xother) const
3057  {
3058  return _pod <= static_cast<pod_type>(xother);
3059  };
3060 
3064  bool operator>(signed char xother) const
3065  {
3066  return _pod > static_cast<pod_type>(xother);
3067  };
3068 
3072  bool operator>=(signed char xother) const
3073  {
3074  return _pod >= static_cast<pod_type>(xother);
3075  };
3076 
3080  scoped_index& operator+=(signed char xother)
3081  {
3082  _pod += static_cast<pod_type>(xother);
3083  return *this;
3084  };
3085 
3089  scoped_index operator+(signed char xother) const
3090  {
3091  scoped_index result(*this);
3092  return result += xother;
3093  };
3094 
3098  scoped_index& operator-=(signed char xother)
3099  {
3100  _pod -= static_cast<pod_type>(xother);
3101  return *this;
3102  };
3103 
3107  scoped_index operator-(signed char xother) const
3108  {
3109  scoped_index result(*this);
3110  return result -= xother;
3111  };
3112 
3116  scoped_index& operator*=(signed char xother)
3117  {
3118  _pod *= static_cast<pod_type>(xother);
3119  return *this;
3120  };
3121 
3125  scoped_index operator*(signed char xother) const
3126  {
3127  scoped_index result(*this);
3128  return result *= xother;
3129  };
3130 
3134  scoped_index& operator/=(signed char xother)
3135  {
3136  _pod /= static_cast<pod_type>(xother);
3137  return *this;
3138  };
3139 
3143  scoped_index operator/(signed char xother) const
3144  {
3145  scoped_index result(*this);
3146  return result /= xother;
3147  };
3148 
3152  scoped_index& operator%=(signed char xother)
3153  {
3154  _pod %= static_cast<pod_type>(xother);
3155  return *this;
3156  };
3157 
3161  scoped_index operator%(signed char xother) const
3162  {
3163  scoped_index result(*this);
3164  return result %= xother;
3165  };
3166 
3167 protected:
3168 
3169 private:
3170 
3172 
3173 
3174  // ===========================================================
3176  // ===========================================================
3178 
3179 public:
3180 
3184  scoped_index(short int xother, const index_space_handle& xid_space)
3185  : _id_spaces(&xid_space.id_spaces()),
3186  _scope_id(xid_space.index()),
3187  _pod(static_cast<pod_type>(xother))
3188  {
3189  };
3190 
3194  scoped_index& operator=(short int xother)
3195  {
3196  // Preconditions:
3197 
3198  require(is_scoped());
3199 
3200  // Body:
3201 
3202  _pod = static_cast<pod_type>(xother);
3203 
3204  // Postconditions:
3205 
3206  // Exit:
3207 
3208  return *this;
3209  };
3210 
3214  bool operator==(short int xother) const
3215  {
3216  return _pod == static_cast<pod_type>(xother);
3217  };
3218 
3222  bool operator!=(short int xother) const
3223  {
3224  return _pod != static_cast<pod_type>(xother);
3225  };
3226 
3230  bool operator<(short int xother) const
3231  {
3232  return _pod < static_cast<pod_type>(xother);
3233  };
3234 
3238  bool operator<=(short int xother) const
3239  {
3240  return _pod <= static_cast<pod_type>(xother);
3241  };
3242 
3246  bool operator>(short int xother) const
3247  {
3248  return _pod > static_cast<pod_type>(xother);
3249  };
3250 
3254  bool operator>=(short int xother) const
3255  {
3256  return _pod >= static_cast<pod_type>(xother);
3257  };
3258 
3262  scoped_index& operator+=(short int xother)
3263  {
3264  _pod += static_cast<pod_type>(xother);
3265  return *this;
3266  };
3267 
3271  scoped_index operator+(short int xother) const
3272  {
3273  scoped_index result(*this);
3274  return result += xother;
3275  };
3276 
3280  scoped_index& operator-=(short int xother)
3281  {
3282  _pod -= static_cast<pod_type>(xother);
3283  return *this;
3284  };
3285 
3289  scoped_index operator-(short int xother) const
3290  {
3291  scoped_index result(*this);
3292  return result -= xother;
3293  };
3294 
3298  scoped_index& operator*=(short int xother)
3299  {
3300  _pod *= static_cast<pod_type>(xother);
3301  return *this;
3302  };
3303 
3307  scoped_index operator*(short int xother) const
3308  {
3309  scoped_index result(*this);
3310  return result *= xother;
3311  };
3312 
3316  scoped_index& operator/=(short int xother)
3317  {
3318  _pod /= static_cast<pod_type>(xother);
3319  return *this;
3320  };
3321 
3325  scoped_index operator/(short int xother) const
3326  {
3327  scoped_index result(*this);
3328  return result /= xother;
3329  };
3330 
3334  scoped_index& operator%=(short int xother)
3335  {
3336  _pod %= static_cast<pod_type>(xother);
3337  return *this;
3338  };
3339 
3343  scoped_index operator%(short int xother) const
3344  {
3345  scoped_index result(*this);
3346  return result %= xother;
3347  };
3348 
3349 protected:
3350 
3351 private:
3352 
3354 
3355 
3356  // ===========================================================
3358  // ===========================================================
3360 
3361 public:
3362 
3366  scoped_index(int xother, const index_space_handle& xid_space)
3367  : _id_spaces(&xid_space.id_spaces()),
3368  _scope_id(xid_space.index()),
3369  _pod(static_cast<pod_type>(xother))
3370  {
3371  };
3372 
3377  {
3378  // Preconditions:
3379 
3380  require(is_scoped());
3381 
3382  // Body:
3383 
3384  _pod = static_cast<pod_type>(xother);
3385 
3386  // Postconditions:
3387 
3388  // Exit:
3389 
3390  return *this;
3391  };
3392 
3396  bool operator==(int xother) const
3397  {
3398  return _pod == static_cast<pod_type>(xother);
3399  };
3400 
3404  bool operator!=(int xother) const
3405  {
3406  return _pod != static_cast<pod_type>(xother);
3407  };
3408 
3412  bool operator<(int xother) const
3413  {
3414  return _pod < static_cast<pod_type>(xother);
3415  };
3416 
3420  bool operator<=(int xother) const
3421  {
3422  return _pod <= static_cast<pod_type>(xother);
3423  };
3424 
3428  bool operator>(int xother) const
3429  {
3430  return _pod > static_cast<pod_type>(xother);
3431  };
3432 
3436  bool operator>=(int xother) const
3437  {
3438  return _pod >= static_cast<pod_type>(xother);
3439  };
3440 
3445  {
3446  _pod += static_cast<pod_type>(xother);
3447  return *this;
3448  };
3449 
3453  scoped_index operator+(int xother) const
3454  {
3455  scoped_index result(*this);
3456  return result += xother;
3457  };
3458 
3463  {
3464  _pod -= static_cast<pod_type>(xother);
3465  return *this;
3466  };
3467 
3471  scoped_index operator-(int xother) const
3472  {
3473  scoped_index result(*this);
3474  return result -= xother;
3475  };
3476 
3481  {
3482  _pod *= static_cast<pod_type>(xother);
3483  return *this;
3484  };
3485 
3489  scoped_index operator*(int xother) const
3490  {
3491  scoped_index result(*this);
3492  return result *= xother;
3493  };
3494 
3499  {
3500  _pod /= static_cast<pod_type>(xother);
3501  return *this;
3502  };
3503 
3507  scoped_index operator/(int xother) const
3508  {
3509  scoped_index result(*this);
3510  return result /= xother;
3511  };
3512 
3517  {
3518  _pod %= static_cast<pod_type>(xother);
3519  return *this;
3520  };
3521 
3525  scoped_index operator%(int xother) const
3526  {
3527  scoped_index result(*this);
3528  return result %= xother;
3529  };
3530 
3531 protected:
3532 
3533 private:
3534 
3536 
3537 
3538  // ===========================================================
3540  // ===========================================================
3542 
3543 public:
3544 
3548  scoped_index(long int xother, const index_space_handle& xid_space)
3549  : _id_spaces(&xid_space.id_spaces()),
3550  _scope_id(xid_space.index()),
3551  _pod(static_cast<pod_type>(xother))
3552  {
3553  };
3554 
3558  scoped_index& operator=(long int xother)
3559  {
3560  // Preconditions:
3561 
3562  require(is_scoped());
3563 
3564  // Body:
3565 
3566  _pod = static_cast<pod_type>(xother);
3567 
3568  // Postconditions:
3569 
3570  // Exit:
3571 
3572  return *this;
3573  };
3574 
3578  bool operator==(long int xother) const
3579  {
3580  return _pod == static_cast<pod_type>(xother);
3581  };
3582 
3586  bool operator!=(long int xother) const
3587  {
3588  return _pod != static_cast<pod_type>(xother);
3589  };
3590 
3594  bool operator<(long int xother) const
3595  {
3596  return _pod < static_cast<pod_type>(xother);
3597  };
3598 
3602  bool operator<=(long int xother) const
3603  {
3604  return _pod <= static_cast<pod_type>(xother);
3605  };
3606 
3610  bool operator>(long int xother) const
3611  {
3612  return _pod > static_cast<pod_type>(xother);
3613  };
3614 
3618  bool operator>=(long int xother) const
3619  {
3620  return _pod >= static_cast<pod_type>(xother);
3621  };
3622 
3626  scoped_index& operator+=(long int xother)
3627  {
3628  _pod += static_cast<pod_type>(xother);
3629  return *this;
3630  };
3631 
3635  scoped_index operator+(long int xother) const
3636  {
3637  scoped_index result(*this);
3638  return result += xother;
3639  };
3640 
3644  scoped_index& operator-=(long int xother)
3645  {
3646  _pod -= static_cast<pod_type>(xother);
3647  return *this;
3648  };
3649 
3653  scoped_index operator-(long int xother) const
3654  {
3655  scoped_index result(*this);
3656  return result -= xother;
3657  };
3658 
3662  scoped_index& operator*=(long int xother)
3663  {
3664  _pod *= static_cast<pod_type>(xother);
3665  return *this;
3666  };
3667 
3671  scoped_index operator*(long int xother) const
3672  {
3673  scoped_index result(*this);
3674  return result *= xother;
3675  };
3676 
3680  scoped_index& operator/=(long int xother)
3681  {
3682  _pod /= static_cast<pod_type>(xother);
3683  return *this;
3684  };
3685 
3689  scoped_index operator/(long int xother) const
3690  {
3691  scoped_index result(*this);
3692  return result /= xother;
3693  };
3694 
3698  scoped_index& operator%=(long int xother)
3699  {
3700  _pod %= static_cast<pod_type>(xother);
3701  return *this;
3702  };
3703 
3707  scoped_index operator%(long int xother) const
3708  {
3709  scoped_index result(*this);
3710  return result %= xother;
3711  };
3712 
3713 protected:
3714 
3715 private:
3716 
3718 
3719 };
3720 
3721 // =============================================================================
3722 // NON-MEMBER FUNCTIONS
3723 // =============================================================================
3724 
3728 SHEAF_DLL_SPEC
3729 std::ostream& operator<<(std::ostream& xos, const scoped_index& xid);
3730 
3734 SHEAF_DLL_SPEC
3735 std::istream& operator>>(std::istream& xis, scoped_index& xid);
3736 
3741 SHEAF_DLL_SPEC
3742 size_t deep_size(const scoped_index& xp, bool xinclude_shallow = true);
3743 
3744 
3745 // =============================================================================
3746 // TEMPLATE SPECIALIZATIONS
3747 // =============================================================================
3748 
3752 template <>
3753 struct SHEAF_DLL_SPEC index_traits<scoped_index>
3754 {
3759 
3764 
3768  static pod_type pod(const index_type& xindex)
3769  {
3770  return xindex.pod();
3771  };
3772 
3776  static void put_pod(index_type& xindex, pod_type& xpod)
3777  {
3778  xindex.put_pod(xpod);
3779  return;
3780  };
3781 
3785  static index_type invalid()
3786  {
3787  return index_type::INVALID();
3788  };
3789 
3793  static bool is_valid(const index_type& xindex)
3794  {
3795  return xindex.is_valid();
3796  };
3797 
3801  static bool is_positive(const index_type& xindex)
3802  {
3803  return xindex.is_positive();
3804  };
3805 
3809  static bool is_positive_definite(const index_type& xindex)
3810  {
3811  return xindex.is_positive_definite();
3812  };
3813 
3814 };
3815 
3816 } // namespace sheaf
3817 
3818 #ifndef SWIG
3819 
3820 // Swig doesn't replace preprocessor macros, except to
3821 // process ifdef, ifndef, etc. So the follwoing macro creates
3822 // a syntax error when processed by swig.
3823 // But swig would ignore the namespace and template declaration
3824 // any way, so just don't process it.
3825 
3826 SHEAF_BEGIN_UNORDERED_NAMESPACE
3827 
3831 template<> struct SHEAF_DLL_SPEC hash<sheaf::scoped_index>
3832 {
3833  size_t operator()(sheaf::scoped_index xindex) const;
3834 };
3835 
3836 SHEAF_END_UNORDERED_NAMESPACE
3837 
3838 #endif // SWIG
3839 
3840 
3841 #endif // ifndef SCOPED_INDEX_H
3842 
bool operator<(unsigned int xother) const
True if this is less than unsigned int xother.
bool operator!=(standard_version_index x) const
True if this does not have the same value as standard_version_index x.
scoped_index operator%(unsigned int xother) const
This modulo unsigned int xother.
primitives_schema_member_index
Ids for standard poset members.
bool operator<(signed char xother) const
True if this is less than signed char xother.
scoped_index & operator+=(int xother)
This := this + int xother.
bool operator<=(standard_dof_tuple_index x) const
True if this is less than or equal to standard_dof_tuple_index x.
bool operator>=(const scoped_index &xother) const
True if this is greater than or equal to xother.
bool is_valid() const
True if this is a valid id.
Definition: scoped_index.h:832
scoped_index(namespace_member_index x, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
bool operator==(long int xother) const
True if this has the same value as long int xother.
bool operator<(unsigned long int xother) const
True if this is less than unsigned long int xother.
scoped_index(standard_version_index x, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
scoped_index & operator%=(unsigned long int xother)
This := this modulo unsigned long int xother.
bool operator>(standard_version_index x) const
True if this is greater than standard_version_index x.
bool operator>(unsigned long int xother) const
True if this is greater than unsigned long int xother.
pod_type pod(const std::string &xname, pod_type xid) const
The pod index in the space with name xname equivalent to xid in the hub id space. ...
bool operator>=(long int xother) const
True if this is greater than or equal to long int xother.
bool operator>=(standard_version_index x) const
True if this is greater than or equal to standard_version_index x.
scoped_index & operator/=(int xother)
This := this / int xother.
scoped_index operator*(unsigned char xother) const
This * unsigned char xother.
scoped_index operator%(long int xother) const
This modulo long int xother.
bool operator>(primitive_type x) const
True if this is greater than primitive_type x.
bool operator>(short int xother) const
True if this is greater than short int xother.
bool in_scope() const
True if and only if scope() contains an entry for pod().
Definition: scoped_index.h:584
bool operator!=(namespace_member_index x) const
True if this does not have the same value as namespace_member_index x.
const pod_type & pod() const
The "plain old data" storage of this; the value in the external id space.
Definition: scoped_index.h:672
bool operator>(long int xother) const
True if this is greater than long int xother.
bool operator>(const scoped_index &xother) const
True if this is greater than xother.
scoped_index operator*(short int xother) const
This * short int xother.
scoped_index operator-(short int xother) const
This - short int xother.
bool operator>(namespace_schema_member_index x) const
True if this is greater than namespace_schema_member_index x.
bool operator<(namespace_member_index x) const
True if this is less than namespace_member_index x.
bool operator>=(primitive_type x) const
True if this is greater than or equal to primitive_type x.
scoped_index(standard_subposet_index x, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
bool operator!=(unsigned long int xother) const
True if this does not have the same value as unsigned long int xother.
scoped_index & operator+=(unsigned long int xother)
This := this + unsigned long int xother.
static index_type invalid()
The invalid index value.
bool operator<=(signed char xother) const
True if this is less than or equal to signed char xother.
scoped_index operator+(const scoped_index &xother) const
This + xother.
standard_member_index
Ids for standard poset members.
bool operator<=(namespace_schema_member_index x) const
True if this is less than or equal to namespace_schema_member_index x.
scoped_index operator-(unsigned short int xother) const
This - unsigned short int xother.
bool operator>=(primitives_schema_member_index x) const
True if this is greater than or equal to primitives_schema_member_index x.
scoped_index & operator<<(const scoped_index &xother)
Maps xother to the id space of this; sets this to the image of xother in the id space of this; return...
Definition: scoped_index.h:601
bool operator>(int xother) const
True if this is greater than int xother.
bool operator!=(unsigned short int xother) const
True if this does not have the same value as unsigned short int xother.
void release_scope(index_space_handle &xid_space) const
Return the id space handle, xid_space to the handle pool.
Definition: scoped_index.h:552
bool operator!=(int xother) const
True if this does not have the same value as int xother.
A client handle for a general, abstract partially order set.
scoped_index operator+(unsigned char xother) const
This + unsigned char xother.
bool operator>=(standard_member_index x) const
True if this is greater than or equal to standard_member_index x.
scoped_index & operator=(short int xother)
Assignment from short int.
scoped_index & operator*=(const scoped_index &xother)
This := this * xother.
scoped_index operator/(unsigned int xother) const
This / unsigned int xother.
scoped_index & operator%=(int xother)
This := this modulo int xother.
scoped_index & operator+=(long int xother)
This := this + long int xother.
bool operator!=(namespace_schema_member_index x) const
True if this does not have the same value as namespace_schema_member_index x.
scoped_index operator*(signed char xother) const
This * signed char xother.
scoped_index & operator*=(signed char xother)
This := this * signed char xother.
scoped_index & operator=(unsigned int xother)
Assignment from unsigned int.
scoped_index operator+(long int xother) const
This + long int xother.
pod_type unglued_hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:724
scoped_index operator/(long int xother) const
This / long int xother.
bool operator==(primitive_type x) const
True if this has the same value as primitive_type x.
index_space_handle & get_scope() const
Allocate an id space handle to the scope from the handle pool..
Definition: scoped_index.h:534
bool operator<=(standard_version_index x) const
True if this is less than or equal to standard_version_index x.
bool operator<(primitive_type x) const
True if this is less than primitive_type x.
scoped_index & operator/=(const scoped_index &xother)
This := this / xother.
scoped_index & operator*=(int xother)
This := this * int xother.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
scoped_index operator-(unsigned long int xother) const
This - unsigned long int xother.
static pod_type invalid_pod()
The pod value of the invalid index.
Definition: scoped_index.h:702
scoped_index & operator-=(signed char xother)
This := this - signed char xother.
virtual const index_space_family & id_spaces() const =0
The id space family for this (const version).
bool operator>(unsigned int xother) const
True if this is greater than unsigned int xother.
bool operator<=(const scoped_index &xother) const
True if this is less than or equal to xother.
scoped_index & operator/=(long int xother)
This := this / long int xother.
bool operator==(namespace_schema_member_index x) const
True if this has the same value as namespace_schema_member_index x.
An encapsulated hub pod_index; intended only for implementing scoped_index "operators" ==~ and !=~; s...
Definition: scoped_index.h:107
bool operator<=(standard_subposet_index x) const
True if this is less than or equal to standard_subposet_index x.
void invalidate()
Make this id invalid.
Definition: scoped_index.h:852
bool operator<(standard_dof_tuple_index x) const
True if this is less than standard_dof_tuple_index x.
scoped_index operator/(unsigned short int xother) const
This / unsigned short int xother.
virtual pod_type index() const =0
Index of this space.
bool operator<=(unsigned long int xother) const
True if this is less than or equal to unsigned long int xother.
bool operator==(standard_member_index x) const
True if this has the same value as standard_member_index x.
scoped_index & operator%=(short int xother)
This := this modulo short int xother.
virtual bool is_attached() const =0
True if this handle is attached to a state.
scoped_index & operator+=(short int xother)
This := this + short int xother.
bool operator!=(unsigned char xother) const
True if this does not have the same value as unsigned char xother.
bool operator>=(short int xother) const
True if this is greater than or equal to short int xother.
scoped_index index_type
The index type.
Features describing T as an index type.
Definition: index_traits.h:38
bool operator>(namespace_member_index x) const
True if this is greater than namespace_member_index x.
bool operator==(scoped_index_hub_pod xother) const
True if and only if the hub_pod of this is equal to xother.
Definition: scoped_index.h:763
bool operator<(namespace_schema_member_index x) const
True if this is less than namespace_schema_member_index x.
const index_space_family & id_spaces() const
The id space family for this scope.
Definition: scoped_index.h:498
scoped_index()
Default constructor; creates an invalid instance.
Definition: scoped_index.h:133
bool operator<(standard_version_index x) const
True if this is less than standard_version_index x.
bool operator>(unsigned char xother) const
True if this is greater than unsigned char xother.
bool operator>(signed char xother) const
True if this is greater than signed char xother.
scoped_index operator%(signed char xother) const
This modulo signed char xother.
scoped_index & operator-=(short int xother)
This := this - short int xother.
bool operator==(int xother) const
True if this has the same value as int xother.
scoped_index operator*(unsigned short int xother) const
This * unsigned short int xother.
bool operator>(standard_subposet_index x) const
True if this is greater than standard_subposet_index x.
scoped_index & operator-=(long int xother)
This := this - long int xother.
static pod_type pod(const index_type &xindex)
Converts an index type xindex to pod_type.
static bool is_valid(const index_type &xindex)
True if xindex is valid.
standard_dof_tuple_index
Ids for standard dof tuples.
bool operator<=(namespace_member_index x) const
True if this is less than or equal to namespace_member_index x.
pod_type scope_id() const
The index of the scope id space.
Definition: scoped_index.h:516
bool same_scope(const scoped_index &xother) const
True if and only if this is in the same id space as xother.
Definition: scoped_index.h:464
scoped_index & operator*=(long int xother)
This := this * long int xother.
scoped_index & operator+=(const scoped_index &xother)
This := this + xother.
bool is_hub_scope() const
True if and only if the id space of this is the hub id space.
Definition: scoped_index.h:575
pod_type glued_hub_pod(const std::string &xname, pod_type xid) const
The pod index in the glued hub id space equivalent to xid in the id space with name xname...
scoped_index operator+(signed char xother) const
This + signed char xother.
scoped_index & operator-=(unsigned int xother)
This := this - unsigned int xother.
scoped_index_hub_pod operator~() const
The hub pod value of this; intended only for use with "operators" ==~ and !=~.
Definition: scoped_index.h:753
scoped_index(standard_member_index x, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
bool operator>=(unsigned long int xother) const
True if this is greater than or equal to unsigned long int xother.
scoped_index & operator/=(short int xother)
This := this / short int xother.
scoped_index & operator*=(unsigned int xother)
This := this * unsigned int xother.
scoped_index(int xother, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
bool operator<=(unsigned int xother) const
True if this is less than or equal to unsigned int xother.
scoped_index(namespace_schema_member_index x, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
void put_scope(const index_space_handle &xid_space)
Sets the scope to xid_space.
Definition: scoped_index.h:441
scoped_index operator/(short int xother) const
This / short int xother.
scoped_index & operator*=(unsigned long int xother)
This := this * unsigned long int xother.
scoped_index operator-(long int xother) const
This - long int xother.
scoped_index & operator=(standard_member_index x)
Assignment from standard_member_index.
bool operator>(scoped_index_hub_pod xother) const
True if and only if the hub_pod of this is greater than to xother.
Definition: scoped_index.h:796
scoped_index operator*(long int xother) const
This * long int xother.
scoped_index & operator=(namespace_member_index x)
Assignment from namespace_member_index.
bool operator==(short int xother) const
True if this has the same value as short int xother.
scoped_index & operator/=(unsigned int xother)
This := this / unsigned int xother.
namespace_schema_member_index
Ids for namespace poset schema members.
scoped_index(const index_space_handle &xid_space, const scoped_index &xother)
Creates an instance equivalent to xother in the scope of xid_space.
Definition: scoped_index.h:208
standard_subposet_index
Ids for standard subposets.
bool operator==(signed char xother) const
True if this has the same value as signed char xother.
bool operator<(primitives_schema_member_index x) const
True if this is less than primitives_schema_member_index x.
primitive_type
Type ids for sheaf primitives.
bool same_id_space_family(const index_space_handle &xid_space) const
True if and only if this is in the same id space family as xid_space.
Definition: scoped_index.h:489
scoped_index & operator=(primitives_schema_member_index x)
Assignment from primitives_schema_member_index.
scoped_index & operator=(standard_dof_tuple_index x)
Assignment from standard_dof_tuple_index.
scoped_index & operator%=(long int xother)
This := this modulo long int xother.
scoped_index & operator>>(scoped_index &xother) const
Maps this to the id space of xother; sets xother to the image of this in the id space of xother; retu...
Definition: scoped_index.h:625
bool operator==(unsigned long int xother) const
True if this has the same value as unsigned long int xother.
scoped_index operator-(unsigned char xother) const
This - unsigned char xother.
scoped_index operator/(int xother) const
This / int xother.
scoped_index(unsigned int xother, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
bool operator!=(signed char xother) const
True if this does not have the same value as signed char xother.
scoped_index & operator+=(signed char xother)
This := this + signed char xother.
bool is_scoped() const
True if and only if scope() is attached.
Definition: scoped_index.h:592
bool operator!=(long int xother) const
True if this does not have the same value as long int xother.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
bool operator==(unsigned short int xother) const
True if this has the same value as unsigned short int xother.
bool operator!=(scoped_index_hub_pod xother) const
True if and only if the hub_pod of this is equal to xother.
Definition: scoped_index.h:771
scoped_index & operator+=(unsigned char xother)
This := this + unsigned char xother.
bool operator<=(int xother) const
True if this is less than or equal to int xother.
scoped_index & operator=(long int xother)
Assignment from long int.
bool operator<(unsigned short int xother) const
True if this is less than unsigned short int xother.
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.
scoped_index operator%(unsigned short int xother) const
This modulo unsigned short int xother.
bool same_id_space_family(const scoped_index &xother) const
True if and only if this is in the same id space family as xother.
Definition: scoped_index.h:480
scoped_index(primitives_schema_member_index x, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
static bool is_positive_definite(const index_type &xindex)
True if xindex is > 0.
scoped_index operator%(const scoped_index &xother) const
This modulo xother.
scoped_index & operator=(signed char xother)
Assignment from signed char.
scoped_index operator+(int xother) const
This + int xother.
scoped_index & operator--()
Prefix decrement.
scoped_index & operator=(int xother)
Assignment from int.
scoped_index(const scoped_index &xother)
Copy constructor.
Definition: scoped_index.h:235
bool operator<(standard_subposet_index x) const
True if this is less than standard_subposet_index x.
bool operator>=(standard_subposet_index x) const
True if this is greater than or equal to standard_subposet_index x.
scoped_index operator%(int xother) const
This modulo int xother.
bool operator>=(unsigned int xother) const
True if this is greater than or equal to unsigned int xother.
scoped_index operator+(unsigned long int xother) const
This + unsigned long int xother.
scoped_index & operator++()
Prefix increment.
scoped_index(long int xother, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
scoped_index & operator%=(const scoped_index &xother)
This := this modulo xother.
bool operator>=(unsigned char xother) const
True if this is greater than or equal to unsigned char xother.
scoped_index & operator%=(signed char xother)
This := this modulo signed char xother.
bool operator<(unsigned char xother) const
True if this is less than unsigned char xother.
void hub_scope()
Maps this to the hub id space.
Definition: scoped_index.h:381
void put(const index_space_handle &xid_space, pod_type xpod)
Set the scope to id space, xid_space and pod() to xpod.
Definition: scoped_index.h:332
bool operator>(unsigned short int xother) const
True if this is greater than unsigned short int xother.
scoped_index & operator/=(unsigned long int xother)
This := this / unsigned long int xother.
bool operator>(standard_dof_tuple_index x) const
True if this is greater than standard_dof_tuple_index x.
static const scoped_index & INVALID()
The invalid id.
Definition: scoped_index.h:871
bool in_range(const scoped_index &xbegin, const scoped_index &xend) const
True if this is greater than or equal to xbegin and less than xend in the id space of xbegin and xend...
bool operator<(const scoped_index &xother) const
True if this is less than xother.
scoped_index operator/(unsigned long int xother) const
This / unsigned long int xother.
bool is_identical_to(const scoped_index &xother) const
True if this is identical to xother, that is, they both have the same id_space and pod...
Definition: scoped_index.h:908
bool operator==(primitives_schema_member_index x) const
True if this has the same value as primitives_schema_member_index x.
scoped_index & operator=(namespace_schema_member_index x)
Assignment from namespace_schema_member_index.
scoped_index & operator+=(unsigned int xother)
This := this + unsigned int xother.
bool operator==(const scoped_index &xother) const
True if this is identical to xother, that is, if this refers to the same member in the same id space ...
Definition: scoped_index.h:962
standard_version_index
Ids for standard poset versions.
namespace_member_index
Ids for standard poset members.
bool operator<=(scoped_index_hub_pod xother) const
True if and only if the hub_pod of this is less than or equal to xother.
Definition: scoped_index.h:788
index_type::pod_type pod_type
The plain old data (POD) type associated with the index type.
bool operator==(standard_subposet_index x) const
True if this has the same value as standard_subposet_index x.
bool operator==(standard_version_index x) const
True if this has the same value as standard_version_index x.
scoped_index & operator%=(unsigned short int xother)
This := this modulo unsigned short int xother.
bool operator>=(namespace_schema_member_index x) const
True if this is greater than or equal to namespace_schema_member_index x.
scoped_index operator*(int xother) const
This * int xother.
scoped_index operator-(const scoped_index &xother) const
This - xother.
scoped_index & operator=(unsigned char xother)
Assignment from unsigned char.
bool operator==(standard_dof_tuple_index x) const
True if this has the same value as standard_dof_tuple_index x.
scoped_index & operator-=(unsigned short int xother)
This := this - unsigned short int xother.
scoped_index(const index_space_handle &xid_space, pod_type xpod)
Creates an instance with pod() == xpod in the scope of xid_space.
Definition: scoped_index.h:182
scoped_index(unsigned char xother, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
scoped_index & operator=(standard_subposet_index x)
Assignment from standard_subposet_index.
scoped_index operator/(signed char xother) const
This / signed char xother.
~scoped_index()
Destructor. Not virtual; this can not be a base class.
Definition: scoped_index.h:277
bool operator<=(standard_member_index x) const
True if this is less than or equal to standard_member_index x.
scoped_index & operator=(unsigned long int xother)
Assignment from unsigned long int.
bool operator!=(unsigned int xother) const
True if this does not have the same value as unsigned int xother.
scoped_index operator*(const scoped_index &xother) const
This * xother.
scoped_index & operator*=(unsigned char xother)
This := this * unsigned char xother.
pod_type glued_hub_pod() const
The pod value of this mapped to the glued hub id space.
Definition: scoped_index.h:738
scoped_index & operator-=(int xother)
This := this - int xother.
SHEAF_DLL_SPEC std::istream & operator>>(std::istream &is, dof_tuple_type &xdt)
Extract dof_tuple_type xdt from istream& is.
scoped_index & operator%=(unsigned char xother)
This := this modulo unsigned char xother.
scoped_index operator-(unsigned int xother) const
This - unsigned int xother.
scoped_index & operator*=(short int xother)
This := this * short int xother.
scoped_index hub_id() const
This mapped to the hub id space.
Definition: scoped_index.h:358
pod_index_type pod_type
The "plain old data" storage type for this.
Definition: scoped_index.h:128
bool operator<(scoped_index_hub_pod xother) const
True if and only if the hub_pod of this is less than to xother.
Definition: scoped_index.h:779
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
scoped_index operator+(unsigned short int xother) const
This + unsigned short int xother.
scoped_index & operator=(unsigned short int xother)
Assignment from unsigned short int.
bool operator!=(standard_subposet_index x) const
True if this does not have the same value as standard_subposet_index x.
bool operator>(primitives_schema_member_index x) const
True if this is greater than primitives_schema_member_index x.
scoped_index & operator-=(const scoped_index &xother)
This := this - xother.
static bool is_positive(const index_type &xindex)
True if xindex is >= 0.
scoped_index operator+(unsigned int xother) const
This + unsigned int xother.
scoped_index operator%(short int xother) const
This modulo short int xother.
bool operator!=(const scoped_index &xother) const
True if this not identical to as xother.
Definition: scoped_index.h:984
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
Namespace for the sheaves component of the sheaf system.
scoped_index & operator=(standard_version_index x)
Assignment from standard_version_index.
scoped_index(const index_space_handle &xid_space)
Creates an invalid instance in the scope of xid_space.
Definition: scoped_index.h:156
static void put_pod(index_type &xindex, pod_type &xpod)
Sets the pod of an index type xindex to xpod.
scoped_index & operator/=(signed char xother)
This := this / signed char xother.
bool operator<=(primitives_schema_member_index x) const
True if this is less than or equal to primitives_schema_member_index x.
scoped_index operator/(const scoped_index &xother) const
This / xother.
scoped_index & operator*=(unsigned short int xother)
This := this * unsigned short int xother.
bool operator>=(signed char xother) const
True if this is greater than or equal to signed char xother.
bool operator!=(primitives_schema_member_index x) const
True if this does not have the same value as primitives_schema_member_index x.
scoped_index & operator/=(unsigned char xother)
This := this / unsigned char xother.
scoped_index & operator=(const scoped_index &xother)
Assignment operator.
Definition: scoped_index.h:293
bool operator>=(unsigned short int xother) const
True if this is greater than or equal to unsigned short int xother.
bool operator>(standard_member_index x) const
True if this is greater than standard_member_index x.
const scoped_index operator--(int)
Postfix decrement.
scoped_index operator%(unsigned long int xother) const
This modulo unsigned long int xother.
bool operator<(long int xother) const
True if this is less than long int xother.
scoped_index operator/(unsigned char xother) const
This / unsigned char xother.
Factory and container for a family of id spaces.
scoped_index & operator=(primitive_type x)
Assignment from primitive_type.
bool operator>=(namespace_member_index x) const
True if this is greater than or equal to namespace_member_index x.
bool operator>=(standard_dof_tuple_index x) const
True if this is greater than or equal to standard_dof_tuple_index x.
bool invariant() const
Class invariant.
Definition: scoped_index.h:417
scoped_index & operator/=(unsigned short int xother)
This := this / unsigned short int xother.
scoped_index(unsigned short int xother, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
scoped_index & operator-=(unsigned long int xother)
This := this - unsigned long int xother.
bool operator==(unsigned int xother) const
True if this has the same value as unsigned int xother.
scoped_index & operator-=(unsigned char xother)
This := this - unsigned char xother.
const scoped_index operator++(int)
Postfix increment.
pod_type unglued_hub_pod(const std::string &xname, pod_type xid) const
The pod index in the unglued hub id space equivalent to xid in the id space with name xname...
bool operator==(namespace_member_index x) const
True if this has the same value as namespace_member_index x.
scoped_index operator%(unsigned char xother) const
This modulo unsigned char xother.
scoped_index operator+(short int xother) const
This + short int xother.
scoped_index operator*(unsigned long int xother) const
This * unsigned long int xother.
scoped_index operator*(unsigned int xother) const
This * unsigned int xother.
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
bool operator==(unsigned char xother) const
True if this has the same value as unsigned char xother.
scoped_index & operator%=(unsigned int xother)
This := this modulo unsigned int xother.
SHEAF_DLL_SPEC pod_index_type invalid_pod_index()
The invalid pod index value.
Definition: pod_types.cc:31
bool operator<=(unsigned short int xother) const
True if this is less than or equal to unsigned short int xother.
bool operator!=(primitive_type x) const
True if this does not have the same value as primitive_type x.
bool operator<=(unsigned char xother) const
True if this is less than or equal to unsigned char xother.
bool operator<(standard_member_index x) const
True if this is less than standard_member_index x.
bool is_positive_definite() const
True if this is greater than ZERO.
bool same_scope(const index_space_handle &xid_space) const
True if and only if this is in the same id space as xid_space.
Definition: scoped_index.h:472
scoped_index & operator+=(unsigned short int xother)
This := this + unsigned short int xother.
scoped_index(standard_dof_tuple_index x, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
scoped_index(primitive_type x, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
bool is_positive() const
True if this is greater than or equal to ZERO.
bool operator!=(standard_dof_tuple_index x) const
True if this does not have the same value as standard_dof_tuple_index x.
bool operator>=(int xother) const
True if this is greater than or equal to int xother.
bool operator<=(short int xother) const
True if this is less than or equal to short int xother.
scoped_index(unsigned long int xother, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
bool operator<(short int xother) const
True if this is less than short int xother.
bool operator<=(primitive_type x) const
True if this is less than or equal to primitive_type x.
void put_pod(pod_type xpod)
Sets pod() to xpod.
Definition: scoped_index.h:680
bool operator>=(scoped_index_hub_pod xother) const
True if and only if the hub_pod of this is greater than or equal to xother.
Definition: scoped_index.h:805
bool is_equivalent_to(const scoped_index &xother) const
True if this is equivalent to xother, that is, if this refers to the same member as xother...
Definition: scoped_index.h:932
scoped_index operator-() const
Negation (unary minus).
bool operator!=(short int xother) const
True if this does not have the same value as short int xother.
scoped_index(short int xother, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.
bool operator<(int xother) const
True if this is less than int xother.
bool operator!=(standard_member_index x) const
True if this does not have the same value as standard_member_index x.
scoped_index operator-(signed char xother) const
This - signed char xother.
scoped_index operator-(int xother) const
This - int xother.
bool operator<=(long int xother) const
True if this is less than or equal to long int xother.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710
scoped_index(signed char xother, const index_space_handle &xid_space)
Creates an instance with pod() == x in the scope of xid_space.