SheafSystem  0.0.0.0
explicit_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 EXPLICIT_INDEX_SPACE_ITERATOR_H
22 #define EXPLICIT_INDEX_SPACE_ITERATOR_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef INDEX_SPACE_ITERATOR_H
29 #include "SheafSystem/index_space_iterator.h"
30 #endif
31 
32 namespace sheaf
33 {
34 
35 class explicit_index_space_state;
36 
42 {
43 
44  friend class explicit_index_space_state;
45 
46  // ===========================================================
48  // ===========================================================
50 
51 public:
52 
57 
58 protected:
59 
64 
69 
74 
79 
83  const explicit_index_space_state& state() const;
84 
89 
90 private:
91 
93 
94 
95  // ===========================================================
97  // ===========================================================
99 
100 public:
101 
105  virtual explicit_index_space_iterator& operator=(const index_space_iterator& xother);
106 
110  virtual bool operator==(const index_space_iterator& xother) const;
111 
116  virtual explicit_index_space_iterator* clone() const = 0;
117 
118 protected:
119 
120 private:
121 
123 
124 
125  // ===========================================================
127  // ===========================================================
129 
130 public:
131 
135  virtual const index_space_collection& host() const;
136 
140  virtual pod_type index() const;
141 
145  virtual bool is_attached() const;
146 
148 
152  virtual void attach_to(pod_type xindex);
153 
158  virtual void attach_to(const index_space_collection& xhost,
159  pod_type xlocal_id);
160 
164  virtual void detach();
165 
167 
172  virtual bool conforms_to_state(const index_space_collection& xhost,
173  pod_type xlocal_id) const;
174 
175 protected:
176 
180  virtual void attach_to(explicit_index_space_state* xstate) = 0;
181 
186  virtual bool conforms_to_state(explicit_index_space_state* xstate) const = 0;
187 
192  explicit_index_space_state* state(pod_type xindex) const;
193 
199  pod_type xlocal_id) const;
200 
201 private:
202 
204 
205 
206  // ===========================================================
208  // ===========================================================
210 
211 public:
212 
216  virtual bool is_ancestor_of(const any *other) const;
217 
221  virtual bool invariant() const;
222 
223 protected:
224 
225 private:
226 
228 
229 };
230 
231 // ===========================================================
232 // NON-MEMBER FUNCTIONS
233 // ===========================================================
234 
235 
236 } // namespace sheaf
237 
238 #endif // ifndef EXPLICIT_INDEX_SPACE_ITERATOR_H
An abstract iterator over the ids of an id space.
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...
void attach_to(const index_space_family &xid_spaces, pod_type xindex)
Attach to the state with index xindex in the id space family xid_spaces.
A collection of id space states. This is a virtual class with provides an interface for accessing the...
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.
explicit_index_space_state * _state
The explicit state.
pod_index_type pod_type
The "plain old data" index type for this.
bool conforms_to_state(const index_space_family &xid_spaces, pod_type xindex) const
True if this conforms to the handle type required by the state with index xindex in the id space fami...