SheafSystem  0.0.0.0
hash_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 HASH_INDEX_SPACE_ITERATOR_H
22 #define HASH_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_UNORDERED_MAP_H
33 #include "SheafSystem/std_unordered_map.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
44 {
45 
46  friend class hash_index_space_state;
47 
48  // ===========================================================
50  // ===========================================================
52 
53 public:
54 
59 
64 
69  pod_type xindex);
70 
75  const std::string& xname);
76 
80  hash_index_space_iterator& operator=(const hash_index_space_iterator& xother);
81 
85  virtual ~hash_index_space_iterator();
86 
87 protected:
88 
92  typedef unordered::unordered_map<pod_type, pod_type> to_hub_type;
93 
97  const to_hub_type* _to_hub;
98 
102  to_hub_type::const_iterator _itr;
103 
104 private:
105 
107 
108 
109  // ===========================================================
111  // ===========================================================
113 
114 public:
115 
116 protected:
117 
118 private:
119 
121 
122 
123  // ===========================================================
125  // ===========================================================
126 
127 public:
128 
132  virtual hash_index_space_iterator& operator=(const index_space_iterator& xother);
133 
137  virtual bool operator==(const index_space_iterator& xother) const;
138 
143  virtual hash_index_space_iterator* clone() const;
144 
145 protected:
146 
147 private:
148 
150 
151 
152  // ===========================================================
154  // ===========================================================
156 
157 public:
158 
162  virtual void next();
163 
167  virtual void reset();
168 
169 protected:
170 
171 private:
172 
174 
175 
176  // ===========================================================
178  // ===========================================================
180 
181 public:
182 
184 
186 
187 protected:
188 
193  virtual void attach_to(explicit_index_space_state* xstate);
194 
199  virtual bool conforms_to_state(explicit_index_space_state* xstate) 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 HASH_INDEX_SPACE_ITERATOR_H
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.
unordered::unordered_map< pod_type, pod_type > to_hub_type
The type of hub id map.
to_hub_type::const_iterator _itr
The stl iterator over ids.
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...
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...
An hash map implementation of class scattered_insertion_index_space_state. This representation is int...
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.
An iterator over an id space in which the equivalence between the ids in the space and the hub id spa...
Factory and container for a family of id spaces.
pod_index_type pod_type
The "plain old data" index type for this.
const to_hub_type * _to_hub
The hash to hub ids.