SheafSystem  0.0.0.0
hub_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 HUB_INDEX_SPACE_HANDLE_H
22 #define HUB_INDEX_SPACE_HANDLE_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef SUM_INDEX_SPACE_HANDLE_H
29 #include "SheafSystem/sum_index_space_handle.h"
30 #endif
31 
32 namespace sheaf
33 {
34 
35 class primary_sum_index_space_state;
36 
41 class SHEAF_DLL_SPEC hub_index_space_handle : public sum_index_space_handle
42 {
43 
44  friend class primary_sum_index_space_state;
45 
46  // ===========================================================
48  // ===========================================================
50 
51 public:
52 
57 
62 
67  pod_type xindex);
68 
73  const std::string& xname);
74 
79  hub_index_space_handle& operator=(const hub_index_space_handle& xother);
80 
84  virtual ~hub_index_space_handle();
85 
86 protected:
87 
92 
94 
99 
103  const primary_sum_index_space_state& state() const;
104 
105 private:
106 
108 
109 
110  // ===========================================================
112  // ===========================================================
114 
115 public:
116 
120  pod_type new_id();
121 
125  pod_type new_id(pod_type xid);
126 
130  void delete_id(pod_type xid);
131 
136  bool is_valid_reserved_id(pod_type xid) const;
137 
141  pod_type next_id() const;
142 
147  pod_type new_primary_term(size_type xct);
148 
153  pod_type new_primary_term(pod_type xid, size_type xct);
154 
158  void remove_term(pod_type xi);
159 
163  void extend_last_term(size_type xct);
164 
168  bool interval_is_full(pod_type xbegin, pod_type xend) const;
169 
173  bool interval_is_empty(pod_type xbegin, pod_type xend) const;
174 
178  bool interval_is_available(pod_type xbegin, pod_type xend) const;
179 
180 protected:
181 
182 private:
183 
185 
186 
187  // ===========================================================
189  // ===========================================================
191 
192 public:
193 
198  void glue(pod_type xid, pod_type xrep);
199 
203  void unglue(pod_type xid);
204 
210  void unglue_all(pod_type xrep_id);
211 
215  bool has_gluing() const;
216 
217 protected:
218 
219 private:
220 
222 
223 
224  // ===========================================================
226  // ===========================================================
228 
229 public:
230 
235  const index_space_handle& new_gathered_id_space(bool xexclude_bottom);
236 
240  void update_gathered_id_space();
241 
245  const index_space_handle& gathered_id_space() const;
246 
250  bool gathered_id_space_excludes_bottom() const;
251 
255  bool has_gathered_id_space() const;
256 
257 protected:
258 
259 private:
260 
262 
263 
264  // ===========================================================
266  // ===========================================================
268 
269 public:
270 
274  void update_standard_ids();
275 
279  bool has_only_standard_ids() const;
280 
284  void clear_ids();
285 
286 protected:
287 
288 private:
289 
291 
292 
293  // ===========================================================
295  // ===========================================================
297 
298 public:
299 
300 protected:
301 
302 private:
303 
305 
306 
307  // ===========================================================
309  // ===========================================================
311 
312 public:
313 
314 protected:
315 
316 private:
317 
319 
320 
321  // ===========================================================
323  // ===========================================================
325 
326 public:
327 
332  virtual hub_index_space_handle& operator=(const index_space_handle& xother);
333 
338  virtual hub_index_space_handle* clone() const;
339 
340 protected:
341 
342 private:
343 
345 
346 
347  // ===========================================================
349  // ===========================================================
351 
352 public:
353 
355 
360  virtual bool conforms_to_state(const index_space_collection& xhost,
361  pod_type xlocal_id) const;
362 
363 protected:
364 
365 private:
366 
368 
369 
370  // ===========================================================
372  // ===========================================================
374 
375 public:
376 
380  virtual bool is_ancestor_of(const any *other) const;
381 
385  virtual bool invariant() const;
386 
387 protected:
388 
389 private:
390 
392 
393 };
394 
395 // ===========================================================
396 // NON-MEMBER FUNCTIONS
397 // ===========================================================
398 
399 } // end namespace sheaf
400 
401 #endif // ifndef HUB_INDEX_SPACE_HANDLE_H
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...
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
An implementation of class sum_index_space_handle that has a primary sum id space state...
explicit_index_space_state & state()
The explicit state (mutable version).
Abstract base class with useful features for all objects.
Definition: any.h:39
pod_index_type pod_type
The "plain old data" index type for this.
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.
Namespace for the sheaves component of the sheaf system.
An implementation of class sum_index_space_state intended for use as the sum of the primary id spaces...
Factory and container for a family of id spaces.