SheafSystem  0.0.0.0
interval_index_space_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 INTERVAL_INDEX_SPACE_ITERATOR_H
22 #define INTERVAL_INDEX_SPACE_ITERATOR_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef EXPLICIT_INDEX_SPACE_ITERATOR_H
29 #include "SheafSystem/explicit_index_space_iterator.h"
30 #endif
31 
32 #ifndef STD_MAP_H
33 #include "SheafSystem/std_map.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
49 {
50 
51  friend class interval_index_space_state;
52 
53  // ===========================================================
55  // ===========================================================
57 
58 public:
59 
64 
69 
74  pod_type xindex);
75 
80  const std::string& xname);
81 
86 
91 
95  void next_interval();
96 
100  pod_type interval_begin() const;
101 
105  pod_type interval_end() const;
106 
107 protected:
108 
112  typedef std::map<pod_type, pod_type> to_hub_type;
113 
117  void update_interval_ids(pod_type xinterval_begin);
118 
122  void invalidate_interval_ids();
123 
127  const to_hub_type* _to_hub;
128 
132  to_hub_type::const_iterator _itr;
133 
137  pod_type _interval_begin;
138 
142  pod_type _interval_end;
143 
144 private:
145 
147 
148 
149  // ===========================================================
151  // ===========================================================
153 
154 public:
155 
156 protected:
157 
158 private:
159 
161 
162 
163  // ===========================================================
165  // ===========================================================
166 
167 public:
168 
172  virtual interval_index_space_iterator& operator=(const index_space_iterator& xother);
173 
177  virtual bool operator==(const index_space_iterator& xother) const;
178 
183  virtual interval_index_space_iterator* clone() const;
184 
185 protected:
186 
187 private:
188 
190 
191 
192  // ===========================================================
194  // ===========================================================
196 
197 public:
198 
202  virtual void next();
203 
207  virtual void reset();
208 
209 protected:
210 
211 private:
212 
214 
215 
216  // ===========================================================
218  // ===========================================================
220 
221 public:
222 
224 
226 
227 protected:
228 
233  virtual void attach_to(explicit_index_space_state* xstate);
234 
239  virtual bool conforms_to_state(explicit_index_space_state* xstate) const;
240 
241 private:
242 
244 
245 
246  // ===========================================================
248  // ===========================================================
250 
251 public:
252 
256  virtual bool is_ancestor_of(const any *other) const;
257 
261  virtual bool invariant() const;
262 
263 protected:
264 
265 private:
266 
268 
269 };
270 
271 // ===========================================================
272 // NON-MEMBER FUNCTIONS
273 // ===========================================================
274 
275 
276 } // namespace sheaf
277 
278 #endif // ifndef INTERVAL_INDEX_SPACE_ITERATOR_H
An STL map implementation of class scattered_insertion_index_space_state optimized to efficiently rep...
virtual void attach_to(pod_type xindex)
Attach to the state with index xindex in the id space family id_spaces().
An abstract iterator over the ids of an id space.
pod_type _interval_end
The end of the current interval.
Abstract base class with useful features for all objects.
Definition: any.h:39
An immutable abstract state for a space of alternate integer identifiers (aliases) for a subset of th...
pod_type _interval_begin
The begin of the current interval.
An iterator over an id space in which the equivalence between the ids in the space and the hub id spa...
to_hub_type::const_iterator _itr
The stl iterator over ids.
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...
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.
An implementation of class index_space_iterator for an explicit_index_space_state.
Namespace for the sheaves component of the sheaf system.
const to_hub_type * _to_hub
The interval to hub ids.
Factory and container for a family of id spaces.
std::map< pod_type, pod_type > to_hub_type
The type of the id maps.