SheafSystem  0.0.0.0
index_space_family_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_FAMILY_ITERATOR_H
22 #define INDEX_SPACE_FAMILY_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 INDEX_SPACE_FAMILY_H
33 #include "SheafSystem/index_space_family.h"
34 #endif
35 
36 #ifndef INDEX_SPACE_INTERVAL_ITERATOR_H
37 #include "SheafSystem/index_space_interval_iterator.h"
38 #endif
39 
40 #ifndef POD_TYPES_H
41 #include "SheafSystem/pod_types.h"
42 #endif
43 
44 namespace sheaf
45 {
46 
50 class SHEAF_DLL_SPEC index_space_family_iterator : public any
51 {
52 
53  // ===========================================================
55  // ===========================================================
57 
58 public:
59 
64 
70  bool xonly_persistent);
71 
75  virtual ~index_space_family_iterator();
76 
81 
85  bool operator==(const index_space_family_iterator& xother) const;
86 
91  index_space_family_iterator* clone() const;
92 
96  bool only_persistent() const;
97 
101  void next();
102 
106  bool is_done() const;
107 
111  void reset();
112 
116  const index_space_interval& host() const;
117 
121  pod_type index() const;
122 
126  std::string name() const;
127 
128 protected:
129 
134 
139 
143  void next_id_space();
144 
149 
153  typedef interval_map_type::const_iterator const_interval_iterator_type;
154 
159 
163  const_interval_iterator_type _interval_itr;
164 
169 
170 private:
171 
173 
174 
175  // ===========================================================
177  // ===========================================================
179 
180 public:
181 
185  const index_space_family& id_spaces() const;
186 
190  const hub_index_space_handle& hub_id_space() const;
191 
195  size_type ct() const;
196 
200  pod_type begin() const;
201 
205  pod_type end() const;
206 
210  bool contains(pod_type xid) const;
211 
215  bool contains_hub(pod_type xid) const;
216 
220  bool contains_unglued_hub(pod_type xid) const;
221 
225  bool contains_glued_hub(pod_type xid) const;
226 
231  bool contains(pod_type xid, pod_type xhub_id) const;
232 
236  pod_type pod(pod_type xid) const;
237 
241  pod_type hub_pod(pod_type xid) const;
242 
246  pod_type unglued_hub_pod(pod_type xid) const;
247 
251  pod_type glued_hub_pod(pod_type xid) const;
252 
256  bool is_persistent() const;
257 
258 protected:
259 
260 private:
261 
263 
264 
265  // ===========================================================
267  // ===========================================================
269 
270 public:
271 
276  index_space_handle& get_id_space() const;
277 
281  void release_id_space(index_space_handle& xid_space) const;
282 
287  bool allocated_id_space(index_space_handle& xid_space) const;
288 
289 protected:
290 
291 private:
292 
294 
295 
296  // ===========================================================
298  // ===========================================================
300 
301 public:
302 
307  index_space_iterator& get_id_space_iterator() const;
308 
312  void release_id_space_iterator(index_space_iterator& xitr) const;
313 
318  bool allocated_id_space_iterator(index_space_iterator& xitr) const;
319 
320 protected:
321 
322 private:
323 
325 
326 
327  // ===========================================================
329  // ===========================================================
331 
332 public:
333 
337  virtual bool is_ancestor_of(const any *other) const;
338 
342  virtual bool invariant() const;
343 
344 protected:
345 
346 private:
347 
349 
350 };
351 
352 // ===========================================================
353 // NON-MEMBER FUNCTIONS
354 // ===========================================================
355 
356 } // namespace sheaf
357 
358 #endif // ifndef INDEX_SPACE_FAMILY_ITERATOR_H
const index_space_family * _id_spaces
The index space family.
interval_map_type::const_iterator const_interval_iterator_type
Type of interval map iterator.
An abstract iterator over the ids of an id space.
index_space_family::interval_map_type interval_map_type
Type of interval map.
index_space_family_iterator()
Default constructor; disabled.
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...
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()...
std::map< pod_type, index_space_interval * > interval_map_type
Type of interval map.
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.
index_space_interval_iterator _id_space_itr
The iterator over id spaces for the current id space 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.
const_interval_iterator_type _interval_itr
The stl iterator over the intervals.
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.
Factory and container for a family of id spaces.
pod_index_type pod_type
The "plain old data" index type for this.