SheafSystem  0.0.0.0
sum_index_space_handle.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 SUM_INDEX_SPACE_HANDLE_H
22 #define SUM_INDEX_SPACE_HANDLE_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef EXPLICIT_INDEX_SPACE_HANDLE_H
29 #include "SheafSystem/explicit_index_space_handle.h"
30 #endif
31 
32 #ifndef STD_LIST_H
33 #include "SheafSystem/std_list.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
39 class sum_index_space_state;
40 
46 {
47 
48  // ===========================================================
50  // ===========================================================
52 
53 public:
54 
59 
64 
69  pod_type xindex);
70 
75  const std::string& xname);
76 
81  sum_index_space_handle& operator=(const sum_index_space_handle& xother);
82 
86  virtual ~sum_index_space_handle();
87 
88 protected:
89 
91 
95  sum_index_space_state& state();
96 
100  const sum_index_space_state& state() const;
101 
102 private:
103 
105 
106 
107  // ===========================================================
109  // ===========================================================
111 
112 public:
113 
117  typedef std::list<pod_type> equivalence_class_type;
118 
122  void equivalence_class(pod_type xhub_id, equivalence_class_type& result) const;
123 
127  size_type equivalence_ct(pod_type xhub_id) const;
128 
133  bool contains_rep(pod_type xhub_id) const;
134 
139  bool contains_unique_rep(pod_type xhub_id) const;
140 
144  pod_type rep(pod_type xhub_id) const;
145 
150  pod_type host_rep(pod_type xhub_id) const;
151 
155  pod_type term_id_begin() const;
156 
160  pod_type term_id_end() const;
161 
165  bool contains_term_id(pod_type xi) const;
166 
170  const index_space_handle& term(pod_type xi) const;
171 
175  const index_space_handle& term_of(pod_type xid) const;
176 
180  const index_space_handle& term_of(const scoped_index& xid) const;
181 
185  const index_space_handle& last_term() const;
186 
190  pod_type term_begin(pod_type xi) const;
191 
195  pod_type term_end(pod_type xi) const;
196 
200  pod_type term_hub_begin(pod_type xi) const;
201 
205  pod_type term_hub_end(pod_type xi) const;
206 
210  pod_type term_id(pod_type xid) const;
211 
215  void binary(pod_type xindex, pod_type& xterm_id, pod_type& xlocal) const;
216 
220  void simple(pod_type xterm_id, pod_type xlocal_id, pod_type& xindex) const;
221 
225  void clear();
226 
227 protected:
228 
229 private:
230 
232 
233 
234  // ===========================================================
236  // ===========================================================
238 
239 public:
240 
241 protected:
242 
243 private:
244 
246 
247 
248  // ===========================================================
250  // ===========================================================
252 
253 public:
254 
259  virtual sum_index_space_handle& operator=(const index_space_handle& xother);
260 
265  virtual sum_index_space_handle* clone() const;
266 
267 protected:
268 
269 private:
270 
272 
273 
274  // ===========================================================
276  // ===========================================================
278 
279 public:
280 
282 
287  virtual bool conforms_to_state(const index_space_collection& xhost,
288  pod_type xlocal_id) const;
289 
290 protected:
291 
292 private:
293 
295 
296 
297  // ===========================================================
299  // ===========================================================
301 
302 public:
303 
307  virtual bool is_ancestor_of(const any *other) const;
308 
312  virtual bool invariant() const;
313 
314 protected:
315 
316 private:
317 
319 
320 };
321 
322 // ===========================================================
323 // NON-MEMBER FUNCTIONS
324 // ===========================================================
325 
326 } // end namespace sheaf
327 
328 #endif // ifndef SUM_INDEX_SPACE_HANDLE_H
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
std::list< pod_type > equivalence_class_type
The type used to represent an equivalence class.
explicit_index_space_state & state()
The explicit state (mutable version).
Abstract base class with useful features for all objects.
Definition: any.h:39
An implementation of class index_space_handle for an explicit_index_space_state.
pod_index_type pod_type
The "plain old data" index type for this.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
An abstract id space of alternate integer identifiers which is the sum (disjoint union) of two or mor...
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
A collection of id space states. This is a virtual class with provides an interface for accessing the...
An implemenation of class explicit_index_space_handle that has a sum id space state.
virtual bool conforms_to_state(const index_space_collection &xhost, pod_type xlocal_id) const
True if this conforms to the handle type required by the state with local scope id xlocal_id in the h...
Namespace for the sheaves component of the sheaf system.
Factory and container for a family of id spaces.