SheafSystem
0.0.0.0
|
Abstract traverser (internal iterator) for poset. More...
#include <poset_traverser.h>
Public Member Functions | |
poset_traverser (const poset_state_handle *xanchor) | |
Constructor. More... | |
~poset_traverser () | |
Destructor. More... | |
virtual bool | invariant () const |
Class invariant. More... | |
poset_state_handle * | host () |
The poset being traversed (mutable version). More... | |
const poset_state_handle * | host () const |
The poset being traversed (const version). More... | |
bool | has_same_host (const poset_component *other) const |
True if other is not void and is attached to the same host as this. More... | |
virtual abstract_poset_member * | anchor () |
The member which is the starting point of this traversal (mutable verison). More... | |
virtual const abstract_poset_member * | anchor () const |
The member which is the starting point of this traversal (const version). More... | |
bool | in_down_set () const |
True if traversing down from anchor(). More... | |
void | traverse (const abstract_poset_member *xanchor, bool down, bool reset_markers=true) |
Traverse the down set (down == true) or up set (down == false) of xanchor. If reset_markers, reset all visited markers to false before begining. More... | |
Public Member Functions inherited from sheaf::any | |
virtual bool | is_ancestor_of (const any *other) const |
True if other conforms to this. More... | |
bool | is_same_type (const any *other) const |
True if other is the same type as this. More... | |
virtual any * | clone () const |
Virtual constructor, makes a new instance of the same type as this. More... | |
virtual | ~any () |
Destructor. More... | |
bool | invariant_check () const |
True if invariant checking is enabled. More... | |
void | enable_invariant_check () const |
Enable invariant checking. More... | |
void | disable_invariant_check () const |
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing invariant checking during multi-phase initialization. More... | |
int | disable_invariance_check_request_depth () const |
Number of times disable_invariant_check has been called without matching call to enable_invariant_check. More... | |
Protected Member Functions | |
bool | has_been_visited (const abstract_poset_member *xmbr) const |
True if xmbr has been previously visited. More... | |
bool | has_been_visited (int xindex) const |
True if the member with index xindex has been previously visited. More... | |
scoped_index | member_index_ub () const |
The upper bound on the member index. More... | |
bool | no_members_visited () const |
True if no members have been visited. More... | |
bool | all_members_visited () const |
True if all members have been visited. More... | |
void | mark_members_not_visited () |
Sets the visited markers false for all members. More... | |
void | mark_visited (const abstract_poset_member *xmbr) |
Sets the visited marker true for xmbr. More... | |
void | mark_visited (int xindex) |
Sets the visited markers true for the emebr with index xindex. More... | |
void | mark_not_visited (int xindex) |
Sets the visited markers false for the emebr with index xindex. More... | |
virtual void | private_traverse ()=0 |
Implements the traversal. More... | |
void | ensure_visited_ub () |
Ensures the visited bit vector is large enough. More... | |
Protected Member Functions inherited from sheaf::any | |
any () | |
default constructor More... | |
Protected Attributes | |
poset_state_handle * | _host |
The poset being traversed. More... | |
zn_to_bool * | _visited |
The markers for previously visited members. More... | |
abstract_poset_member * | _anchor |
The member which is the starting point of this traversal. More... | |
bool | _in_down_set |
True if traversing down from anchor(). More... | |
Abstract traverser (internal iterator) for poset.
Definition at line 49 of file poset_traverser.h.
sheaf::poset_traverser::poset_traverser | ( | const poset_state_handle * | xanchor | ) |
Constructor.
Definition at line 130 of file poset_traverser.cc.
References _anchor, _host, _in_down_set, _visited, invariant(), member_index_ub(), sheaf::read_write_monitor_handle::state_is_read_accessible(), and ~poset_traverser().
Referenced by anchor().
sheaf::poset_traverser::~poset_traverser | ( | ) |
Destructor.
Definition at line 153 of file poset_traverser.cc.
References _visited, and traverse().
Referenced by poset_traverser().
|
protected |
True if all members have been visited.
Definition at line 273 of file poset_traverser.cc.
References _host, sheaf::index_iterator::index(), sheaf::index_iterator::is_done(), mark_members_not_visited(), sheaf::poset_state_handle::member_iterator(), sheaf::index_iterator::next(), and sheaf::scoped_index::pod().
Referenced by no_members_visited().
|
virtual |
The member which is the starting point of this traversal (mutable verison).
Definition at line 89 of file poset_traverser.cc.
References _anchor.
Referenced by has_same_host(), sheaf::poset_dft::private_traverse(), and traverse().
|
virtual |
The member which is the starting point of this traversal (const version).
Definition at line 111 of file poset_traverser.cc.
References _anchor, and poset_traverser().
|
inlineprotected |
Ensures the visited bit vector is large enough.
Definition at line 208 of file poset_traverser.h.
References sheaf::zn_to_bool::extend_to(), sheaf::scoped_index::pod(), and sheaf::zn_to_bool::ub().
Referenced by sheaf::poset_dft::recursive_dft(), and traverse().
|
protected |
True if xmbr has been previously visited.
Definition at line 210 of file poset_traverser.cc.
References host(), sheaf::poset_component::host(), sheaf::poset_component::index(), sheaf::poset_component::is_attached(), member_index_ub(), and sheaf::scoped_index::pod().
Referenced by sheaf::poset_slicer::find_jims_pa(), sheaf::poset_slicer::find_pa(), mark_visited(), sheaf::poset_orderer::postvisit_action(), sheaf::poset_dft::recursive_dft(), traverse(), and sheaf::poset_slicer::up_set_pa().
|
inlineprotected |
True if the member with index xindex has been previously visited.
Definition at line 154 of file poset_traverser.h.
bool sheaf::poset_traverser::has_same_host | ( | const poset_component * | other | ) | const |
True if other is not void and is attached to the same host as this.
Definition at line 67 of file poset_traverser.cc.
References anchor(), host(), and sheaf::poset_component::host().
Referenced by sheaf::poset_slicer::down_set(), sheaf::poset_slicer::down_set_pa(), sheaf::poset_slicer::find(), sheaf::poset_slicer::find_jims(), sheaf::poset_slicer::find_jims_pa(), sheaf::poset_slicer::find_pa(), invariant(), sheaf::poset_orderer::postvisit_action(), sheaf::poset_orderer::restore_order(), traverse(), sheaf::poset_slicer::up_set(), and sheaf::poset_slicer::up_set_pa().
|
inline |
The poset being traversed (mutable version).
Definition at line 78 of file poset_traverser.h.
Referenced by sheaf::poset_slicer::find_jims_pa(), has_been_visited(), has_same_host(), sheaf::poset_orderer::postvisit_action(), sheaf::poset_dft::recursive_dft(), sheaf::poset_orderer::restore_order(), and sheaf::poset_slicer::up_set_pa().
|
inline |
The poset being traversed (const version).
Definition at line 86 of file poset_traverser.h.
|
inline |
True if traversing down from anchor().
Definition at line 111 of file poset_traverser.h.
|
virtual |
Class invariant.
Reimplemented from sheaf::any.
Reimplemented in sheaf::poset_orderer, and sheaf::poset_slicer.
Definition at line 45 of file poset_traverser.cc.
References _anchor, _host, _visited, has_same_host(), sheaf::poset_component::host(), sheaf::poset_component::is_attached(), member_index_ub(), sheaf::scoped_index::pod(), sheaf::read_write_monitor_handle::state_is_read_accessible(), and sheaf::zn_to_bool::ub().
Referenced by sheaf::poset_slicer::invariant(), sheaf::poset_orderer::invariant(), sheaf::poset_dft::poset_dft(), poset_traverser(), and traverse().
|
protected |
Sets the visited markers false for all members.
Definition at line 305 of file poset_traverser.cc.
References _visited, sheaf::zn_to_bool::make_false_sa(), mark_visited(), and no_members_visited().
Referenced by all_members_visited(), sheaf::poset_slicer::find_jims_pa(), sheaf::poset_slicer::find_pa(), traverse(), and sheaf::poset_slicer::up_set_pa().
|
inlineprotected |
Sets the visited markers false for the emebr with index xindex.
Definition at line 195 of file poset_traverser.h.
References sheaf::zn_to_bool::force().
|
protected |
Sets the visited marker true for xmbr.
Definition at line 329 of file poset_traverser.cc.
References _anchor, _visited, sheaf::zn_to_bool::force(), has_been_visited(), sheaf::poset_component::host(), sheaf::poset_component::index(), sheaf::poset_component::is_attached(), and sheaf::scoped_index::pod().
Referenced by mark_members_not_visited(), and sheaf::poset_dft::recursive_dft().
|
inlineprotected |
Sets the visited markers true for the emebr with index xindex.
Definition at line 187 of file poset_traverser.h.
References sheaf::zn_to_bool::force().
|
protected |
The upper bound on the member index.
Definition at line 231 of file poset_traverser.cc.
References _host, sheaf::poset_state_handle::member_index_ub(), and no_members_visited().
Referenced by has_been_visited(), invariant(), sheaf::poset_orderer::poset_orderer(), and poset_traverser().
|
protected |
True if no members have been visited.
Definition at line 250 of file poset_traverser.cc.
References _visited, all_members_visited(), and sheaf::zn_to_bool::is_false().
Referenced by mark_members_not_visited(), and member_index_ub().
|
protectedpure virtual |
void sheaf::poset_traverser::traverse | ( | const abstract_poset_member * | xanchor, |
bool | down, | ||
bool | reset_markers = true |
||
) |
Traverse the down set (down == true) or up set (down == false) of xanchor. If reset_markers, reset all visited markers to false before begining.
Definition at line 165 of file poset_traverser.cc.
References _anchor, _in_down_set, anchor(), ensure_visited_ub(), has_been_visited(), has_same_host(), invariant(), mark_members_not_visited(), private_traverse(), and sheaf::read_write_monitor_handle::state_is_read_accessible().
Referenced by sheaf::poset_slicer::find_jims_pa(), sheaf::poset_slicer::find_pa(), sheaf::poset_orderer::restore_order(), sheaf::poset_slicer::up_set_pa(), and ~poset_traverser().
|
protected |
The member which is the starting point of this traversal.
Definition at line 137 of file poset_traverser.h.
Referenced by anchor(), sheaf::poset_slicer::find_jims_pa(), sheaf::poset_slicer::find_pa(), invariant(), mark_visited(), poset_traverser(), sheaf::poset_dft::private_traverse(), sheaf::poset_dft::recursive_dft(), traverse(), and sheaf::poset_slicer::up_set_pa().
|
protected |
The poset being traversed.
Definition at line 127 of file poset_traverser.h.
Referenced by all_members_visited(), sheaf::poset_slicer::down_set(), sheaf::poset_slicer::find(), sheaf::poset_slicer::find_jims(), sheaf::poset_slicer::invariant(), invariant(), member_index_ub(), poset_traverser(), sheaf::poset_orderer::postvisit_action(), and sheaf::poset_slicer::up_set().
|
protected |
True if traversing down from anchor().
Definition at line 142 of file poset_traverser.h.
Referenced by sheaf::poset_slicer::find_jims_pa(), sheaf::poset_slicer::find_pa(), poset_traverser(), sheaf::poset_dft::recursive_dft(), traverse(), and sheaf::poset_slicer::up_set_pa().
|
protected |
The markers for previously visited members.
Definition at line 132 of file poset_traverser.h.
Referenced by invariant(), mark_members_not_visited(), mark_visited(), no_members_visited(), poset_traverser(), and ~poset_traverser().