SheafSystem  0.0.0.0
index_equivalence_class.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 INDEX_EQUIVALENCE_CLASS_H
22 #define INDEX_EQUIVALENCE_CLASS_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef ANY_H
29 #include "SheafSystem/any.h"
30 #endif
31 
32 #ifndef BLOCK_H
33 #include "SheafSystem/block.h"
34 #endif
35 
36 #ifndef POD_TYPES_H
37 #include "SheafSystem/pod_types.h"
38 #endif
39 
40 #ifndef SCOPED_INDEX_H
41 #include "SheafSystem/scoped_index.h"
42 #endif
43 
44 #ifndef STD_LIST_H
45 #include "SheafSystem/std_list.h"
46 #endif
47 
48 #ifndef STD_UTILITY_H
49 #include "SheafSystem/std_utility.h"
50 #endif
51 
52 namespace sheaf
53 {
54 
55 class index_space_family;
56 
63 class SHEAF_DLL_SPEC index_equivalence_class
64 {
65 
66  friend class index_equivalence_iterator;
67 
68  // ===========================================================
70  // ===========================================================
72 
73 public:
74 
79 
85  typedef std::pair<pod_type, pod_type> member_type;
86 
90  typedef std::list<member_type> list_type;
91 
98  bool xonly_persistent,
99  bool xsort_ids);
100 
104  virtual ~index_equivalence_class();
105 
109  index_equivalence_class& operator=(const index_equivalence_class& xother);
110 
114  const list_type& equivalence_list(pod_index_type xrep_id) const;
115 
119  const list_type& equivalence_list(const scoped_index& xrep_id) const;
120 
124  size_type equivalence_ct(pod_index_type xrep_id) const;
125 
129  size_type equivalence_ct(const scoped_index& xrep_id) const;
130 
134  bool contains_rep_id(pod_index_type xrep_id) const;
135 
139  bool contains_rep_id(const scoped_index& xrep_id) const;
140 
144  static bool id_space_less_than(const member_type& xitem1, const member_type& xitem2);
145 
146 protected:
147 
152 
157 
161  block<list_type> _equivalence_lists;
162 
163 private:
164 
166 };
167 
168 // ===========================================================
169 // NON-MEMBER FUNCTIONS
170 // ===========================================================
171 
172 } // namespace sheaf
173 
174 #endif // ifndef INDEX_EQUIVALENCE_CLASS_H
pod_index_type pod_type
The "plain old data" index type for this.
index_equivalence_class(const index_equivalence_class &xother)
Copy constructor; disabled.
std::pair< pod_type, pod_type > member_type
The member type for the equivalence id list. The first value in the pair is the index of the id space...
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
std::list< member_type > list_type
The equivalence id list type for this.
index_equivalence_class()
Default constructor; disabled.
Data structure containing the id equivalence class for ab id space family. This class is used as a te...
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
Namespace for the sheaves component of the sheaf system.
An iterator over members of an id equivalence class.
Factory and container for a family of id spaces.