SheafSystem  0.0.0.0
filtered_depth_first_member_iterator.h
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 
18 // Interface for class filtered_depth_first_member_iterator
19 
20 #ifndef FILTERED_DEPTH_FIRST_MEMBER_ITERATOR_H
21 #define FILTERED_DEPTH_FIRST_MEMBER_ITERATOR_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef ANY_H
28 #include "SheafSystem/any.h"
29 #endif
30 
31 #ifndef FILTERED_DEPTH_FIRST_ITERATOR_H
32 #include "SheafSystem/filtered_depth_first_iterator.h"
33 #endif
34 
35 namespace sheaf
36 {
37 
38 class subposet;
39 class zn_to_bool;
40 
48 class SHEAF_DLL_SPEC filtered_depth_first_member_iterator : public any
49 {
50 
51 public:
52 
53  // CANONICAL MEMBERS
54 
59 
64 
69 
73  virtual bool is_ancestor_of(const any* other) const;
74 
78  virtual filtered_depth_first_member_iterator* clone() const = 0;
79 
83  bool invariant() const;
84 
85  // SOME USEFUL CONSTANTS
86 
90 /* static const bool DOWN; */
91 
92 /* /// */
93 /* /// Iteration directions */
94 /* /// */
95 /* static const bool UP; */
96 
97 /* /// */
98 /* /// Iteration marker reset control */
99 /* /// */
100 /* static const bool RESET; */
101 
102 /* /// */
103 /* /// Iteration marker reset control */
104 /* /// */
105 /* static const bool NO_RESET; */
106 
107 /* /// */
108 /* /// Iteration strictness control */
109 /* /// */
110 /* static const bool STRICT; */
111 
112 /* /// */
113 /* /// Iteration strictness control */
114 /* /// */
115 /* static const bool NOT_STRICT; */
116 
117 
118  // ITERATOR FACET
119 
125 
130  bool is_initialized() const;
131 
136  virtual abstract_poset_member& anchor();
137 
142  virtual const abstract_poset_member& anchor() const;
143 
147  virtual void put_anchor(const abstract_poset_member* xanchor);
148 
152  virtual void put_anchor(pod_index_type xanchor_hub_id);
153 
157  void put_anchor(const scoped_index& xanchor_id);
158 
163  const subposet& filter() const;
164 
168  void put_filter(const subposet& filter);
169 
173  void put_filter(const std::string& xfilter_name);
174 
178  void put_filter(pod_index_type xfilter_hub_id);
179 
183  void put_filter(const scoped_index& xfilter_id);
184 
188  bool descending() const;
189 
193  void put_descending(bool xdescending);
194 
198  bool strict() const;
199 
203  void put_strict(bool xstrict);
204 
208  bool is_done() const;
209 
213  virtual void next();
214 
218  virtual void reset(bool xreset_markers = RESET);
219 
224  int ct(bool xreset = false);
225 
229  bool has_visited(pod_index_type xhub_id) const;
230 
234  bool has_visited(const scoped_index& xid) const;
235 
239  bool has_visited(const abstract_poset_member& xmbr) const;
240 
246  void put_has_visited(pod_index_type xhub_id, bool xvalue);
247 
253  void put_has_visited(const scoped_index& xid, bool xvalue);
254 
258  const scoped_index& greater_index() const;
259 
264  const scoped_index& lesser_index() const;
265 
266  // MEMBER ITERATOR FACET
267 
268  // Item is not virtual; descendant redefinitions
269  // with covariant signature hide this version.
270 
274  abstract_poset_member& item();
275 
279  const abstract_poset_member& item() const;
280 
284  virtual bool item_is_ancestor_of(const abstract_poset_member& xmbr) const;
285 
289  virtual bool anchor_is_ancestor_of(const abstract_poset_member& xmbr) const;
290 
291 
292 protected:
293 
298  abstract_poset_member* xitem);
299 
304  virtual void update_item();
305 
310 
315 
316 private:
317 
322 
323 };
324 
325 } // namespace sheaf
326 
327 #endif // ifndef FILTERED_DEPTH_FIRST_MEMBER_ITERATOR_H
A client handle for a subposet.
Definition: subposet.h:86
filtered_depth_first_iterator * _iterator
The index iterator used to implement the iteration.
order_type
The types of order in which the iterator will visit the members of the poset. Determines which action...
Abstract base class with useful features for all objects.
Definition: any.h:39
const bool RESET
Iteration marker reset control.
Definition: sheaf.h:87
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
abstract_poset_member * _item
The member handle for the current item in the iteration.
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.
An abstract client handle for a member of a poset.