SheafSystem  0.0.0.0
triorder_iterator.cc
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 // Implementation for class triorder_iterator
19 
20 #include "SheafSystem/triorder_iterator.h"
21 #include "SheafSystem/assert_contract.h"
22 
26 {
27 
28  // Preconditions:
29 
30  // Body:
31 
32  initialize_order(TRIORDER);
33 
34  // Postconditions:
35 
36  ensure(invariant());
37  ensure(!is_initialized());
38 
39  // Exit
40 
41  return;
42 }
43 
47 {
48 
49  // Preconditions:
50 
51  // Body:
52 
53  // Postconditions:
54 
55  ensure(invariant());
56 
57  // Exit
58 
59  return;
60 }
61 
64 {
65  // Preconditions:
66 
67  // Body:
68 
69  // Postconditions:
70 
71 }
72 
73 
74 
75 
76 
77 
78 bool
80 is_ancestor_of(const any* xother) const
81 {
82  bool result;
83 
84  // Preconditions:
85 
86  // Body:
87 
88  result = dynamic_cast<const triorder_iterator*>(xother) != 0;
89 
90  // Postconditions:
91 
92  // Exit
93 
94  return result;
95 }
96 
99 clone() const
100 {
101  triorder_iterator* result;
102 
103  // Preconditions:
104 
105  // Body:
106 
107  result = new triorder_iterator;
108 
109  // Postconditions:
110 
111  ensure(result != 0);
112  ensure(is_same_type(result));
113  ensure(!result->is_initialized());
114 
115  // Exit
116 
117  return result;
118 }
119 
120 bool
122 invariant() const
123 {
124  bool result = true;
125 
126  // Preconditions:
127 
128  // Body:
129 
131  invariance(order()==TRIORDER);
132 
133  // Postconditions:
134 
135  // Exit
136 
137  return result;
138 }
139 
140 // OTHER CONSTRUCTORS
141 
142 
145  bool xdown,
146  bool xstrict)
147  : filtered_depth_first_iterator(xanchor, xdown, xstrict, TRIORDER)
148 {
149 
150  // Preconditions:
151 
152  // Body:
153 
154  // Postconditions:
155 
156  ensure(invariant());
157 
158  // Exit:
159 
160  return;
161 }
162 
165  const subposet& xfilter,
166  bool xdown,
167  bool xstrict)
168  : filtered_depth_first_iterator(xanchor, xfilter, xdown, xstrict, TRIORDER)
169 {
170 
171  // Preconditions:
172 
173  // Body:
174 
175  // Postconditions:
176 
177  ensure(invariant());
178 
179  // Exit:
180 
181  return;
182 }
183 
186  pod_index_type xfilter_index,
187  bool xdown,
188  bool xstrict)
189  : filtered_depth_first_iterator(xanchor, xfilter_index, xdown, xstrict, TRIORDER)
190 {
191 
192  // Preconditions:
193 
194  // Body:
195 
196  // Postconditions:
197 
198  ensure(invariant());
199 
200  // Exit:
201 
202  return;
203 }
204 
207  const scoped_index& xfilter_index,
208  bool xdown,
209  bool xstrict)
210  : filtered_depth_first_iterator(xanchor, xfilter_index, xdown, xstrict, TRIORDER)
211 {
212 
213  // Preconditions:
214 
215  // Body:
216 
217  // Postconditions:
218 
219  ensure(invariant());
220 
221  // Exit:
222 
223  return;
224 }
225 
228  const std::string& xfilter_name,
229  bool xdown,
230  bool xstrict)
231  : filtered_depth_first_iterator(xanchor, xfilter_name, xdown, xstrict, TRIORDER)
232 {
233 
234  // Preconditions:
235 
236  // Body:
237 
238  // Postconditions:
239 
240  ensure(invariant());
241 
242  // Exit:
243 
244  return;
245 }
A client handle for a subposet.
Definition: subposet.h:86
virtual bool is_initialized() const
True if this has been initialized for iteration with respect to a specific anchor.
void initialize_order(order_type xorder)
Initializes _order and _transition_fcn.
triorder_iterator()
Default constructor; creates an unattached iterator, with and all-pass filter.
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
Abstract base class with useful features for all objects.
Definition: any.h:39
order_type order() const
The order of the iteration. Determines which actions are exported to the client.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
bool invariant() const
The class invariant.
virtual triorder_iterator * clone() const
Make a new instance of the same type as this.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
An abstract client handle for a member of a poset.
bool is_same_type(const any *other) const
True if other is the same type as this.
Definition: any.cc:79