SheafSystem  0.0.0.0
implicit_entry_map_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 IMPLICIT_ENTRY_MAP_ITERATOR_H
22 #define IMPLICIT_ENTRY_MAP_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 IMPLICIT_ENTRY_MAP_H
33 #include "SheafSystem/implicit_entry_map.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
43 template <typename E, typename I>
44 class SHEAF_DLL_SPEC implicit_entry_map_iterator : public any
45 {
46 
47  // ===========================================================
49  // ===========================================================
51 
52 public:
53 
58 
63 
68 
72  E& item();
73 
77  const E& item() const;
78 
82  pod_type id() const;
83 
87  void next();
88 
92  bool is_done() const;
93 
97  void reset();
98 
99 protected:
100 
105 
110 
111 private:
112 
116  const implicit_entry_map<E, I>* _map;
117 
121  pod_type _id;
122 
126  mutable E* _item;
127 
131  typedef typename implicit_entry_map<E, I>::explicit_value_map_type explicit_value_map_type;
132 
136  typedef typename explicit_value_map_type::const_iterator explicit_value_iterator;
137 
141  explicit_value_iterator _explicit_value_itr;
142 
146  typedef typename implicit_entry_map<E, I>::interval_map_type interval_map_type;
147 
151  typedef typename interval_map_type::const_iterator interval_iterator_type;
152 
156  interval_iterator_type _interval_itr;
157 
161  pod_type _end;
162 
164 
165 
166  // ===========================================================
168  // ===========================================================
170 
171 public:
172 
176  virtual bool is_ancestor_of(const any *other) const;
177 
182  virtual implicit_entry_map_iterator* clone() const;
183 
188 
192  virtual bool invariant() const;
193 
194 protected:
195 
196 private:
197 
199 
200 };
201 
202 // ===========================================================
203 // NON-MEMBER FUNCTIONS
204 // ===========================================================
205 
206 } // namespace sheaf
207 
208 #endif // ifndef IMPLICIT_ENTRY_MAP_ITERATOR_H
Abstract base class with useful features for all objects.
Definition: any.h:39
A map in which the entries may be implicit.
implicit_entry_map_iterator()
Default constructor; disabled.
An iterator over the entries in an implicit_entry_map. This iteration is NOT order preserving...
Namespace for the sheaves component of the sheaf system.
pod_index_type pod_type
The "plain old data" index type for this.
implicit_entry_map< E, I >::pod_type pod_type
The "plain old data" index type for this.