SheafSystem  0.0.0.0
index_space_interval_iterator.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_SPACE_INTERVAL_ITERATOR_H
22 #define INDEX_SPACE_INTERVAL_ITERATOR_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 POD_TYPES_H
33 #include "SheafSystem/pod_types.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
39 class hub_index_space_handle;
40 class index_space_interval;
41 class index_space_family;
42 class index_space_handle;
43 class index_space_iterator;
44 
48 class SHEAF_DLL_SPEC index_space_interval_iterator : public any
49 {
50 
51  friend class index_space_family;
52  friend class index_space_family_iterator;
53 
54  // ===========================================================
56  // ===========================================================
58 
59 public:
60 
65 
70 
75 
79  bool operator==(const index_space_interval_iterator& xother) const;
80 
85  index_space_interval_iterator* clone() const;
86 
90  const index_space_interval& host() const;
91 
95  bool only_persistent() const;
96 
100  size_type ub() const;
101 
105  void next();
106 
110  bool is_done() const;
111 
115  void reset();
116 
120  pod_type index() const;
121 
122 protected:
123 
128 
133 
137  index_space_interval_iterator(bool xonly_persistent);
138 
142  void attach_to(index_space_interval& xhost);
143 
147  void detach();
148 
152  bool is_attached() const;
153 
158 
163 
167  pod_type _local_id;
168 
173 
174 private:
175 
177 
178 
179  // ===========================================================
181  // ===========================================================
183 
184 public:
185 
189  const index_space_family& id_spaces() const;
190 
194  index_space_family& id_spaces();
195 
199  const hub_index_space_handle& hub_id_space() const;
200 
204  size_type ct() const;
205 
209  pod_type begin() const;
210 
214  pod_type end() const;
215 
219  bool contains(pod_type xid) const;
220 
224  bool contains_hub(pod_type xid) const;
225 
229  bool contains_unglued_hub(pod_type xid) const;
230 
234  bool contains_glued_hub(pod_type xid) const;
235 
240  bool contains(pod_type xid, pod_type xhub_id) const;
241 
245  pod_type pod(pod_type xid) const;
246 
250  pod_type hub_pod(pod_type xid) const;
251 
255  pod_type unglued_hub_pod(pod_type xid) const;
256 
260  pod_type glued_hub_pod(pod_type xid) const;
261 
265  bool is_persistent() const;
266 
267 protected:
268 
269 private:
270 
272 
273 
274  // ===========================================================
276  // ===========================================================
278 
279 public:
280 
285  index_space_handle& get_id_space() const;
286 
290  void release_id_space(index_space_handle& xid_space) const;
291 
296  bool allocated_id_space(index_space_handle& xid_space) const;
297 
298 protected:
299 
300 private:
301 
303 
304 
305  // ===========================================================
307  // ===========================================================
309 
310 public:
311 
316  index_space_iterator& get_id_space_iterator() const;
317 
321  void release_id_space_iterator(index_space_iterator& xitr) const;
322 
327  bool allocated_id_space_iterator(index_space_iterator& xitr) const;
328 
329 protected:
330 
331 private:
332 
334 
335 
336  // ===========================================================
338  // ===========================================================
340 
341 public:
342 
346  virtual bool is_ancestor_of(const any *other) const;
347 
351  virtual bool invariant() const;
352 
353 protected:
354 
355 private:
356 
358 
359 };
360 
361 // ===========================================================
362 // NON-MEMBER FUNCTIONS
363 // ===========================================================
364 
365 } // namespace sheaf
366 
367 #endif // ifndef INDEX_SPACE_INTERVAL_ITERATOR_H
size_type _ub
The upper bound of the iteration.
An abstract iterator over the ids of an id space.
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...
bool _only_persistent
True if only the persistent id spaces are iterated over.
An abstract iterator over the id spaces of a interval.
Abstract base class with useful features for all objects.
Definition: any.h:39
An implemenation of index_space_collection that adds an interface for the interval [begin()...
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
An abstract iterator over the id spaces of a interval.
bool operator==(const singly_linked_list< T, Alloc > &lhs, const singly_linked_list< T, Alloc > &rhs)
Checks if the contents of lhs and rhs are equal, that is, whether lhs.size() == rhs.size() and each element in lhs compares equal with the element in rhs at the same position.
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.
index_space_interval_iterator()
Default constructor; disabled.
Factory and container for a family of id spaces.
index_space_interval * _host
The host id space interval being iterated over.
pod_type _local_id
The local id of the current id space in the iteration.