21 #ifndef FILTERED_DEPTH_FIRST_ITR_IMPL_H 22 #define FILTERED_DEPTH_FIRST_ITR_IMPL_H 24 #ifndef FILTERED_DEPTH_FIRST_ITR_H 25 #include "SheafSystem/filtered_depth_first_itr.h" 28 #ifndef POSET_STATE_HANDLE_H 29 #include "SheafSystem/poset_state_handle.h" 32 #ifndef ASSERT_CONTRACT_H 33 #include "SheafSystem/assert_contract.h" 37 #include "SheafSystem/subposet.h" 41 #include "SheafSystem/zn_to_bool.h" 44 #ifndef SHEAF_DLL_SPEC_H 45 #include "SheafSystem/sheaf_dll_spec.h" 99 ensure(this->
is_initialized() ? this->
filter().is_same_state(&(const_cast<filtered_depth_first_itr&>(xother).
filter())) :
true);
103 ensure(unexecutable(
this is
first member of iteration or
is_done()));
110 template <
typename T>
129 ensure(this->
is_initialized() ? this->
filter().is_same_state(&(const_cast<filtered_depth_first_itr&>(xother).
filter())) :
true);
133 ensure(unexecutable(
this is
first member of iteration or
is_done()));
141 template <
typename T>
158 template <
typename T>
192 ensure(this->
anchor().is_same_state(&xanchor));
195 ensure(this->
filter().is_attached());
197 ensure(this->
strict() == xstrict);
200 ensure(unexecutable(!this->
is_done() implies
this is
first member));
205 template <
typename T>
241 ensure(this->
anchor().is_same_state(&xanchor));
244 ensure(this->
filter().is_attached());
246 ensure(this->
strict() == xstrict);
249 ensure(unexecutable(!this->
is_done() implies
this is
first member));
254 template <
typename T>
290 ensure(this->
anchor().is_same_state(&xanchor));
293 ensure(this->
filter().is_attached());
294 ensure(this->
strict() == xstrict);
297 ensure(unexecutable(!this->
is_done() implies
this is
first member));
302 template <
typename T>
336 ensure(this->
anchor().is_same_state(&xanchor));
339 ensure(this->
filter().is_attached());
340 ensure(this->
strict() == xstrict);
343 ensure(unexecutable(!this->
is_done() implies
this is
first member));
348 template <
typename T>
351 const std::string& xfilter_name,
382 ensure(this->
anchor().is_same_state(&xanchor));
385 ensure(this->
filter().is_attached());
386 ensure(!xfilter_name.empty() ?
390 ensure(this->
strict() == xstrict);
393 ensure(unexecutable(!this->
is_done() implies
this is
first member));
409 template <
typename T>
416 require(xanchor != 0);
422 define_old_variable(
bool old_descending = this->
_descending);
423 define_old_variable(
bool old_strict = this->
_strict);
439 ensure(this->
anchor().is_same_state(xanchor));
444 ensure(this->
strict() == old_strict);
450 template <
typename T>
458 require(this->
anchor().state_is_read_accessible());
459 require(this->
anchor().host()->contains_member(xanchor_index));
463 define_old_variable(
bool old_descending = this->
_descending);
464 define_old_variable(
bool old_strict = this->
_strict);
466 define_old_variable(
int old_anchor_version = this->
anchor().version());
483 ensure(this->
anchor().version() == old_anchor_version);
484 ensure(this->
filter().
index() == old_filter_index);
486 ensure(this->
strict() == old_strict);
492 template <
typename T>
500 require(this->
anchor().state_is_read_accessible());
501 require(this->
anchor().host()->contains_member(xanchor_index));
505 define_old_variable(
bool old_descending = this->
_descending);
506 define_old_variable(
bool old_strict = this->
_strict);
508 define_old_variable(
int old_anchor_version = this->
anchor().version());
518 ensure(this->
anchor().version() == old_anchor_version);
519 ensure(this->
filter().
index() == old_filter_index);
521 ensure(this->
strict() == old_strict);
527 template <
typename T>
547 template <
typename T>
560 ensure(this->
strict() == xstrict);
567 template <
typename T>
576 require(this->
anchor().state_is_read_accessible());
577 require(this->
anchor().host()->includes_subposet(&xfilter));
581 define_old_variable(
bool old_descending = this->
_descending);
582 define_old_variable(
bool old_strict = this->
_strict);
597 ensure(this->
filter().is_same_state(&xfilter));
599 ensure(this->
strict() == old_strict);
605 template <
typename T>
614 require(this->
anchor().state_is_read_accessible());
619 define_old_variable(
bool old_descending = this->
_descending);
620 define_old_variable(
bool old_strict = this->
_strict);
636 ensure(!xfilter_name.empty() ?
640 ensure(this->
strict() == old_strict);
645 template <
typename T>
653 require(this->
anchor().state_is_read_accessible());
654 require(this->
anchor().host()->includes_subposet(xfilter_index));
658 define_old_variable(
bool old_descending = this->
_descending);
659 define_old_variable(
bool old_strict = this->
_strict);
677 ensure(this->
strict() == old_strict);
682 template <
typename T>
691 require(this->
anchor().state_is_read_accessible());
692 require(this->
anchor().host()->includes_subposet(xfilter_index));
696 define_old_variable(
bool old_descending = this->
_descending);
697 define_old_variable(
bool old_strict = this->
_strict);
715 ensure(this->
strict() == old_strict);
731 template <
typename T>
751 template <
typename T>
774 template <
typename T>
812 #endif // ifndef FILTERED_DEPTH_FIRST_ITR_IMPL_H poset_state_handle * host() const
The poset which this is a handle to a component of.
A client handle for a subposet.
virtual abstract_poset_member & anchor()
The poset member whose downset is being iterated over; the top member of the domain of iteration...
virtual void reset(bool xreset_markers=true)
Restarts the iteration over the down set of anchor().
void put_filter(const subposet &xfilter)
Sets the subposet which is the filter.
bool is_done() const
True if iteration finished.
order_type
The types of order in which the iterator will visit the members of the poset. Determines which action...
int version(bool xunalias=true) const
The (possibly aliased) version of this component. The version of the host used when evaluating proper...
void initialize_order(order_type xorder)
Initializes _order and _transition_fcn.
void initialize_filter()
Initializes the filter subposet from the client filter.
pod_index_type version_index() const
The subposet index for the filter associated with version().
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
bool _descending
True if iterating over the up/down set of anchor.
order_type order() const
The order of the iteration. Determines which actions are exported to the client.
virtual bool includes_subposet(pod_index_type xsubposet_hub_id, bool xauto_access=true) const
True if this poset includes subposet with hub id xsubposet_hub_id.
bool invariant() const
The class invariant.
void put_descending(bool xdescending)
Set descending() to xdescending.
~filtered_depth_first_itr()
Destructor.
The general depth-first iterator over the intersection of a subposet filter with a directional (up or...
filtered_depth_first_itr & operator=(const filtered_depth_first_itr &xother)
Assignment operator.
abstract_poset_member * _anchor
The top member of the down set being iterated over.
const scoped_index & index() const
The index of the current member of the iteration.
Abstract base class with useful features for all objects.
virtual void force_is_done()
Force the iterator to be done.
bool visit_once() const
True if traversal should only visit a member once; that is, it should not revisit members it has alre...
The general depth-first iterator over the intersection of a poset member anchor's whole with its down...
void initialize_traversal(const abstract_poset_member &xanchor)
Initializes the anchor, has_visited markers and filter.
filtered_depth_first_itr()
Default constructor; creates an unattached iterator, with and all-pass filter.
An index within the external ("client") scope of a given id space.
bool strict() const
True if iterating over xstrict up/down set of anchor.
subposet & filter()
The subposet which is the filter; Defines what is passed, not what is blocked.
virtual bool anchor_is_ancestor_of(const abstract_poset_member &xmbr) const
True if xmbr conforms to the type of anchor of this.
bool _new_filter
True if this allocated a new filter;.
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
virtual bool is_ancestor_of(const any *other) const
True if other conforms to this.
virtual filtered_depth_first_itr * clone() const
Make a new instance of the same type as this.
virtual void put_anchor(const abstract_poset_member *xanchor)
Set anchor() to xanchor.
bool invariant_check() const
True if invariant checking is enabled.
int_type pod_index_type
The plain old data index type.
Namespace for the sheaves component of the sheaf system.
void first()
Moves this to the first member of the iteration.
An abstract client handle for a member of a poset.
virtual bool is_initialized() const
True if this has been initialized for iteration with respect to a specific anchor.
bool descending() const
True if iterating over down set of anchor.
std::string version_name() const
The subposet name for the filter associated with version().
bool is_same_type(const any *other) const
True if other is the same type as this.
void enable_invariant_check() const
Enable invariant checking.
void put_strict(bool xstrict)
Set strict() to xstrict.
bool _strict
True if iterating over the strict up/down set of anchor.
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.