SheafSystem  0.0.0.0
poset_dof_iterator.h
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 
6 // Interface for class poset_dof_iterator
7 
8 #ifndef POSET_DOF_ITERATOR_H
9 #define POSET_DOF_ITERATOR_H
10 
11 #ifndef SHEAF_DLL_SPEC_H
12 #include "SheafSystem/sheaf_dll_spec.h"
13 #endif
14 
15 #ifndef ANY_H
16 #include "SheafSystem/any.h"
17 #endif
18 
19 #ifndef POSTORDER_ITERATOR_H
20 #include "SheafSystem/postorder_iterator.h"
21 #endif
22 
23 namespace sheaf
24 {
25 
26 class subposet;
27 class schema_poset_member;
28 class zn_to_bool;
29 
35 class SHEAF_DLL_SPEC poset_dof_iterator : public any
36 {
37 
38 public:
39 
40  // CANONICAL MEMBERS
41 
47 
52 
56  virtual poset_dof_iterator& operator=(const poset_dof_iterator& xother);
57 
61  virtual ~poset_dof_iterator();
62 
66  virtual bool is_ancestor_of(const any* other) const;
67 
71  virtual poset_dof_iterator* clone() const;
72 
76  virtual bool invariant() const;
77 
78  // SOME USEFUL CONSTANTS
79 
80 
85  {
86  ANCHOR_VERSION = CURRENT_MEMBER_VERSION,
87  ANCHOR_HOST_VERSION = CURRENT_HOST_VERSION
88  };
89 
90  // OTHER CONSTRUCTORS
91 
98  explicit poset_dof_iterator(const schema_poset_member& xanchor,
99  bool xis_table_dof = false,
100  int xversion = ANCHOR_VERSION);
101 
102  // ITERATOR FACET
103 
108  virtual bool is_initialized() const;
109 
110  // Anchor is not virtual; descendant redefinitions
111  // with covariant signature hide this version.
112 
117  schema_poset_member& anchor();
118 
123  const schema_poset_member& anchor() const;
124 
129  virtual void put_anchor(const schema_poset_member* xanchor, int xversion);
130 
135  virtual void put_anchor(pod_index_type xindex);
136 
141  void put_anchor(const scoped_index& xid);
142 
146  virtual bool is_done() const;
147 
151  virtual void force_is_done();
152 
156  virtual void next();
157 
162  virtual void reset(bool xreset_markers = RESET);
163 
168  virtual int ct(bool xreset = false);
169 
173  virtual bool has_visited(pod_index_type xhub_id) const;
174 
178  bool has_visited(const scoped_index& xindex) const;
179 
183  virtual bool has_visited(const schema_poset_member& xmbr) const;
184 
190  virtual void put_has_visited(pod_index_type xhub_id, bool xvalue);
191 
197  void put_has_visited(const scoped_index& xid, bool xvalue);
198 
199  // DOF ITERATOR FACET
200 
201  // Item is not virtual; descendant redefinitions
202  // with covariant signature hide this version.
203 
207  schema_poset_member& item();
208 
212  const schema_poset_member& item() const;
213 
217  virtual bool item_is_ancestor_of(const schema_poset_member& xmbr) const;
218 
222  virtual const scoped_index& index();
223 
227  bool is_table_dof() const;
228 
229 protected:
230 
236 
240  virtual void reset_item();
241 
246  virtual void update_item();
247 
252 
257 
262 };
263 
264 } // namespace sheaf
265 
266 #endif // ifndef POSET_DOF_ITERATOR_H
anchor_version_index
Identifiers for anchor version.
Dperecated. Use postorder_itr. Specialization of the filtered depth-first iterator which exposes the ...
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
Iterates in postorder over dofs of a schema member anchor. Attaches a handle of type schema_poset_mem...
postorder_iterator _itr
The index iterator used to implement the iteration.
bool _is_table_dof
True if iterating over table dofs.
schema_poset_member * _anchor
The schema member whose downset is being iterated over; the top member of the domain of 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.
schema_poset_member * _item
The member handle for the current item in the iteration.
A client handle for a poset member which has been prepared for use as a schema.