SheafSystem  0.0.0.0
interval_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 INTERVAL_INDEX_SPACE_HANDLE_H
22 #define INTERVAL_INDEX_SPACE_HANDLE_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef SCATTERED_INSERTION_INDEX_SPACE_HANDLE_H
29 #include "SheafSystem/scattered_insertion_index_space_handle.h"
30 #endif
31 
32 namespace sheaf
33 {
34 
35 class interval_index_space_state;
36 
42 {
43 
44  friend class interval_index_space_state;
45 
46  // ===========================================================
48  // ===========================================================
50 
51 public:
52 
58  static interval_index_space_handle new_space(index_space_family& xid_spaces,
59  const std::string& xname,
60  bool xis_persistent,
61  bool xmerge_mode);
62 
63 protected:
64 
65 private:
66 
68 
69 
70  // ===========================================================
72  // ===========================================================
74 
75 public:
76 
81 
86 
91  pod_type xindex);
92 
97  const std::string& xname);
98 
104 
108  virtual ~interval_index_space_handle();
109 
110 protected:
111 
116 
118 
123 
127  const interval_index_space_state& state() const;
128 
129 private:
130 
132 
133 
134  // ===========================================================
136  // ===========================================================
138 
139 public:
140 
146  void insert_interval(pod_type xbegin,
147  pod_type xend,
148  const scoped_index& xhub_begin,
149  const scoped_index& xhub_end);
150 
155  void insert_interval(pod_type xbegin,
156  pod_type xend,
157  pod_type xhub_begin,
158  pod_type xhub_end);
159 
165  void push_interval(const scoped_index& xhub_begin,
166  const scoped_index& xhub_end);
167 
171  void push_interval(pod_type xhub_begin, pod_type xhub_end);
172 
179  size_type remove_interval(const scoped_index& xhub_begin,
180  const scoped_index& xhub_end);
181 
187  size_type remove_hub_interval(pod_type xhub_begin, pod_type xhub_end);
188 
194  size_type remove_interval(pod_type xbegin, pod_type xend);
195 
200  pod_type interval_begin(const scoped_index& xid) const;
201 
205  pod_type interval_begin(pod_type xhub_id) const;
206 
211  pod_type interval_end(const scoped_index& xid) const;
212 
216  pod_type interval_end(pod_type xhub_id) const;
217 
221  bool merge_mode() const;
222 
226  void put_merge_mode(bool xvalue);
227 
228 protected:
229 
230 private:
231 
233 
234 
235  // ===========================================================
237  // ===========================================================
239 
240 public:
241 
242 protected:
243 
244 private:
245 
247 
248 
249  // ===========================================================
251  // ===========================================================
253 
254 public:
255 
259  void print_map_rep(std::ostream& xos) const;
260 
261 protected:
262 
263 private:
264 
266 
267 
268  // ===========================================================
270  // ===========================================================
272 
273 public:
274 
275 protected:
276 
277 private:
278 
280 
281 
282  // ===========================================================
284  // ===========================================================
286 
287 public:
288 
293  virtual interval_index_space_handle& operator=(const index_space_handle& xother);
294 
299  virtual interval_index_space_handle* clone() const;
300 
301 protected:
302 
303 private:
304 
306 
307 
308  // ===========================================================
310  // ===========================================================
312 
313 public:
314 
316 
321  virtual bool conforms_to_state(const index_space_collection& xhost,
322  pod_type xlocal_id) const;
323 
324 protected:
325 
326 private:
327 
329 
330 
331  // ===========================================================
333  // ===========================================================
335 
336 public:
337 
341  virtual bool is_ancestor_of(const any *other) const;
342 
346  virtual bool invariant() const;
347 
348 protected:
349 
350 private:
351 
353 
354 };
355 
356 // ===========================================================
357 // NON-MEMBER FUNCTIONS
358 // ===========================================================
359 
360 } // end namespace sheaf
361 
362 #endif // ifndef INTERVAL_INDEX_SPACE_HANDLE_H
An implementation of class scattered_insertion_index_space_handle that has a interval id space state...
An STL map implementation of class scattered_insertion_index_space_state optimized to efficiently rep...
scattered_insertion_index_space_state & state()
The mutable id space state (mutable version).
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
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.
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
A collection of id space states. This is a virtual class with provides an interface for accessing the...
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...
A handle for a scattered_insertion_index_space_state.
Namespace for the sheaves component of the sheaf system.
Factory and container for a family of id spaces.