SheafSystem  0.0.0.0
sheaf::preorder_member_iterator Class Reference

#include <preorder_member_iterator.h>

Inheritance diagram for sheaf::preorder_member_iterator:
sheaf::filtered_depth_first_member_iterator sheaf::any

Public Member Functions

 preorder_member_iterator ()
 Default constructor; creates an unattached iterator, with and all-pass filter. More...
 
 preorder_member_iterator (const preorder_member_iterator &xother)
 Copy constructor. More...
 
virtual preorder_member_iteratoroperator= (const filtered_depth_first_member_iterator &xother)
 Assignment operator. More...
 
preorder_member_iteratoroperator= (const preorder_member_iterator &xother)
 Assignment operator. More...
 
virtual ~preorder_member_iterator ()
 Destructor. More...
 
virtual bool is_ancestor_of (const any *other) const
 True if other conforms to this. More...
 
virtual preorder_member_iteratorclone () const
 Make a new instance of the same type as this. More...
 
bool invariant () const
 The class invariant. More...
 
 preorder_member_iterator (const abstract_poset_member &xanchor, bool xdown, bool xstrict)
 Creates an iterator anchored at xanchor, no filter. If xdown, iterate in the down direction, otherwise iterate up. If xstrict, iterate over strict up/down set only. More...
 
 preorder_member_iterator (const abstract_poset_member &xanchor, const subposet &xfilter, bool xdown, bool xstrict)
 Creates an iterator anchored at xanchor, filtered by xfilter. If xdown, iterate in the down direction, otherwise iterate up. If xstrict, iterate over strict up/down set only. More...
 
 preorder_member_iterator (const abstract_poset_member &xanchor, pod_index_type xfilter_index, bool xdown, bool xstrict)
 Creates an iterator anchored at xanchor, filtered by xfilter_index. If xdown, iterate in the down direction, otherwise iterate up. If xstrict, iterate over strict up/down set only. More...
 
 preorder_member_iterator (const abstract_poset_member &xanchor, const scoped_index &xfilter_index, bool xdown, bool xstrict)
 Creates an iterator anchored at xanchor, filtered by xfilter_index. If xdown, iterate in the down direction, otherwise iterate up. If xstrict, iterate over strict up/down set only. More...
 
 preorder_member_iterator (const abstract_poset_member &xanchor, const std::string &xfilter_name, bool xdown, bool xstrict)
 Creates an iterator anchored at xanchor, filtered by xfilter_name. If xdown, iterate in the down direction, otherwise iterate up. If xstrict, iterate over strict up/down set only. More...
 
void truncate ()
 Makes this the next member of the subset which is not less than old this, i.e. the depth-first descent is truncated and the cover of this is not visited. More...
 
- Public Member Functions inherited from sheaf::filtered_depth_first_member_iterator
 filtered_depth_first_member_iterator (const filtered_depth_first_member_iterator &xother)
 Copy constructor. More...
 
virtual ~filtered_depth_first_member_iterator ()
 Destructor. More...
 
depth_first_iterator::order_type order ()
 Iteration directions. More...
 
bool is_initialized () const
 True if this has been initialized for iteration with respect to a specific anchor. More...
 
virtual abstract_poset_memberanchor ()
 The poset member whose downset is being iterated over; the top member of the domain of iteration (mutable version). More...
 
virtual const abstract_poset_memberanchor () const
 The poset member whose downset is being iterated over; the top member of the domain of iteration (const version). More...
 
virtual void put_anchor (const abstract_poset_member *xanchor)
 Set anchor() to *xanchor. More...
 
virtual void put_anchor (pod_index_type xanchor_hub_id)
 Set anchor() to member at xanchor_hub_id. More...
 
void put_anchor (const scoped_index &xanchor_id)
 Set anchor() to member at xanchor_id. More...
 
const subposetfilter () const
 The subposet which is the filter; Defines what is passed, not what is blocked. More...
 
void put_filter (const subposet &filter)
 Sets the subposet which is the filter. More...
 
void put_filter (const std::string &xfilter_name)
 Sets the subposet which is the filter. More...
 
void put_filter (pod_index_type xfilter_hub_id)
 Sets the subposet which is the filter. More...
 
void put_filter (const scoped_index &xfilter_id)
 Sets the subposet which is the filter. More...
 
bool descending () const
 True if iterating over down set of anchor. More...
 
void put_descending (bool xdescending)
 Set descending() to xdescending. More...
 
bool strict () const
 True if iterating over xstrict up/down set of anchor. More...
 
void put_strict (bool xstrict)
 Set strict() to xstrict. More...
 
bool is_done () const
 True if iteration finished. More...
 
virtual void next ()
 Makes this the next member of the iteration. More...
 
virtual void reset (bool xreset_markers=RESET)
 Restarts the iteration. More...
 
int ct (bool xreset=false)
 The number of members of the iteration set, from the current member to the end, inclusive. If xreset, reset before computing the count. More...
 
bool has_visited (pod_index_type xhub_id) const
 True if this has already visited member with hub id xhub_id. More...
 
bool has_visited (const scoped_index &xid) const
 True if this has already visited member with id xid. More...
 
bool has_visited (const abstract_poset_member &xmbr) const
 True if this has already visited member xmbr. More...
 
void put_has_visited (pod_index_type xhub_id, bool xvalue)
 Set the visited marker for hub id xhub_id to xvalue. Intended for use reseting iterator without having to reset entire collection of markers. More...
 
void put_has_visited (const scoped_index &xid, bool xvalue)
 Set the visisted marker for id xid to xvalue. Intended for use reseting iterator without having to reset entire collection of markers. More...
 
const scoped_indexgreater_index () const
 The index of the greater member of the current link. More...
 
const scoped_indexlesser_index () const
 The index of the lesser member of the current link lesser_index() == index() More...
 
abstract_poset_memberitem ()
 The the current member of the iteration (mutable version). More...
 
const abstract_poset_memberitem () const
 The the current member of the iteration (const version). More...
 
virtual bool item_is_ancestor_of (const abstract_poset_member &xmbr) const
 True if xmbr conforms to the type of item of this. More...
 
virtual bool anchor_is_ancestor_of (const abstract_poset_member &xmbr) const
 True if xmbr conforms to the type of anchor of this. More...
 
- Public Member Functions inherited from sheaf::any
bool is_same_type (const any *other) const
 True if other is 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...
 

Additional Inherited Members

- Protected Member Functions inherited from sheaf::filtered_depth_first_member_iterator
 filtered_depth_first_member_iterator (filtered_depth_first_iterator *xitr, abstract_poset_member *xitem)
 Covariant constructor; supports virtual construction of data members. More...
 
virtual void update_item ()
 Attaches the item handle to the current index, or detaches the item handle if is_done. More...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 
- Protected Attributes inherited from sheaf::filtered_depth_first_member_iterator
abstract_poset_member_item
 The member handle for the current item in the iteration. More...
 
filtered_depth_first_iterator_iterator
 The index iterator used to implement the iteration. More...
 

Detailed Description

Deprecated:
No replacement. Iterates in preorder over the intersection of a subposet filter with a directional (up or down) set of a poset member anchor. Attaches an a handle of type abstract_poset_member to the current member of the iteration.

Definition at line 44 of file preorder_member_iterator.h.

Constructor & Destructor Documentation

◆ preorder_member_iterator() [1/7]

sheaf::preorder_member_iterator::preorder_member_iterator ( )

Default constructor; creates an unattached iterator, with and all-pass filter.

Postcondition
  • !is_initialized()

Definition at line 29 of file preorder_member_iterator.cc.

References invariant(), and sheaf::filtered_depth_first_member_iterator::is_initialized().

Referenced by clone(), invariant(), and preorder_member_iterator().

◆ preorder_member_iterator() [2/7]

sheaf::preorder_member_iterator::preorder_member_iterator ( const preorder_member_iterator xother)

◆ ~preorder_member_iterator()

sheaf::preorder_member_iterator::~preorder_member_iterator ( )
virtual

Destructor.

Definition at line 129 of file preorder_member_iterator.cc.

References is_ancestor_of().

Referenced by operator=().

◆ preorder_member_iterator() [3/7]

sheaf::preorder_member_iterator::preorder_member_iterator ( const abstract_poset_member xanchor,
bool  xdown,
bool  xstrict 
)

Creates an iterator anchored at xanchor, no filter. If xdown, iterate in the down direction, otherwise iterate up. If xstrict, iterate over strict up/down set only.

Precondition
  • item_is_ancestor_of(xanchor)
  • xanchor.state_is_read_accessible()
Postcondition
  • -unexecutable( preorder - have visited all children of this )
  • -unexecutable( !is_done() implies this is first member )
  • item().is_attached() == !is_done()

Definition at line 215 of file preorder_member_iterator.cc.

References sheaf::filtered_depth_first_member_iterator::anchor(), sheaf::filtered_depth_first_member_iterator::descending(), sheaf::filtered_depth_first_member_iterator::filter(), invariant(), sheaf::filtered_depth_first_member_iterator::is_done(), sheaf::filtered_depth_first_member_iterator::is_initialized(), sheaf::any::is_same_type(), sheaf::filtered_depth_first_member_iterator::item(), sheaf::filtered_depth_first_member_iterator::item_is_ancestor_of(), preorder_member_iterator(), sheaf::read_write_monitor_handle::state_is_read_accessible(), and sheaf::filtered_depth_first_member_iterator::strict().

◆ preorder_member_iterator() [4/7]

sheaf::preorder_member_iterator::preorder_member_iterator ( const abstract_poset_member xanchor,
const subposet xfilter,
bool  xdown,
bool  xstrict 
)

Creates an iterator anchored at xanchor, filtered by xfilter. If xdown, iterate in the down direction, otherwise iterate up. If xstrict, iterate over strict up/down set only.

Precondition
  • item_is_ancestor_of(xanchor)
  • xanchor.state_is_read_accessible()
  • xanchor.host()->includes_subposet(&xfilter)
Postcondition
  • -unexecutable( preorder - have visited all children of this )
  • -unexecutable( !is_done() implies this is first member )
  • item().is_attached() == !is_done()

Definition at line 250 of file preorder_member_iterator.cc.

References sheaf::filtered_depth_first_member_iterator::anchor(), sheaf::filtered_depth_first_member_iterator::descending(), sheaf::filtered_depth_first_member_iterator::filter(), sheaf::poset_component::host(), sheaf::poset_state_handle::includes_subposet(), invariant(), sheaf::filtered_depth_first_member_iterator::is_done(), sheaf::filtered_depth_first_member_iterator::is_initialized(), sheaf::any::is_same_type(), sheaf::filtered_depth_first_member_iterator::item(), sheaf::filtered_depth_first_member_iterator::item_is_ancestor_of(), preorder_member_iterator(), sheaf::read_write_monitor_handle::state_is_read_accessible(), and sheaf::filtered_depth_first_member_iterator::strict().

◆ preorder_member_iterator() [5/7]

sheaf::preorder_member_iterator::preorder_member_iterator ( const abstract_poset_member xanchor,
pod_index_type  xfilter_index,
bool  xdown,
bool  xstrict 
)

Creates an iterator anchored at xanchor, filtered by xfilter_index. If xdown, iterate in the down direction, otherwise iterate up. If xstrict, iterate over strict up/down set only.

Precondition
  • item_is_ancestor_of(xanchor)
  • xanchor.state_is_read_accessible()
  • xanchor.host()->includes_subposet(xfilter_index)
Postcondition
  • -unexecutable( preorder - have visited all children of this )
  • -unexecutable( !is_done() implies this is first member )
  • item().is_attached() == !is_done()

Definition at line 289 of file preorder_member_iterator.cc.

References sheaf::filtered_depth_first_member_iterator::anchor(), sheaf::filtered_depth_first_member_iterator::descending(), sheaf::filtered_depth_first_member_iterator::filter(), sheaf::poset_component::host(), sheaf::poset_state_handle::includes_subposet(), invariant(), sheaf::filtered_depth_first_member_iterator::is_done(), sheaf::filtered_depth_first_member_iterator::is_initialized(), sheaf::any::is_same_type(), sheaf::filtered_depth_first_member_iterator::item(), sheaf::filtered_depth_first_member_iterator::item_is_ancestor_of(), preorder_member_iterator(), sheaf::read_write_monitor_handle::state_is_read_accessible(), and sheaf::filtered_depth_first_member_iterator::strict().

◆ preorder_member_iterator() [6/7]

sheaf::preorder_member_iterator::preorder_member_iterator ( const abstract_poset_member xanchor,
const scoped_index xfilter_index,
bool  xdown,
bool  xstrict 
)

Creates an iterator anchored at xanchor, filtered by xfilter_index. If xdown, iterate in the down direction, otherwise iterate up. If xstrict, iterate over strict up/down set only.

Precondition
  • item_is_ancestor_of(xanchor)
  • xanchor.state_is_read_accessible()
  • xanchor.host()->includes_subposet(xfilter_index)
Postcondition
  • -unexecutable( preorder - have visited all children of this )
  • -unexecutable( !is_done() implies this is first member )
  • item().is_attached() == !is_done()

Definition at line 327 of file preorder_member_iterator.cc.

References sheaf::filtered_depth_first_member_iterator::anchor(), sheaf::filtered_depth_first_member_iterator::descending(), sheaf::filtered_depth_first_member_iterator::filter(), sheaf::poset_component::host(), sheaf::poset_state_handle::includes_subposet(), invariant(), sheaf::filtered_depth_first_member_iterator::is_done(), sheaf::filtered_depth_first_member_iterator::is_initialized(), sheaf::any::is_same_type(), sheaf::filtered_depth_first_member_iterator::item(), sheaf::filtered_depth_first_member_iterator::item_is_ancestor_of(), preorder_member_iterator(), sheaf::read_write_monitor_handle::state_is_read_accessible(), and sheaf::filtered_depth_first_member_iterator::strict().

◆ preorder_member_iterator() [7/7]

sheaf::preorder_member_iterator::preorder_member_iterator ( const abstract_poset_member xanchor,
const std::string &  xfilter_name,
bool  xdown,
bool  xstrict 
)

Creates an iterator anchored at xanchor, filtered by xfilter_name. If xdown, iterate in the down direction, otherwise iterate up. If xstrict, iterate over strict up/down set only.

Precondition
  • item_is_ancestor_of(xanchor)
  • xanchor.state_is_read_accessible()
  • !xfilter_name.empty() ? xanchor.host()->includes_subposet(xfilter_name) : true
Postcondition
  • -unexecutable( preorder - have visited all children of this )
  • -unexecutable( !is_done() implies this is first member )
  • item().is_attached() == !is_done()

Definition at line 366 of file preorder_member_iterator.cc.

References sheaf::filtered_depth_first_member_iterator::anchor(), sheaf::filtered_depth_first_member_iterator::descending(), sheaf::filtered_depth_first_member_iterator::filter(), sheaf::poset_component::host(), sheaf::poset_state_handle::includes_subposet(), invariant(), sheaf::filtered_depth_first_member_iterator::is_done(), sheaf::filtered_depth_first_member_iterator::is_initialized(), sheaf::any::is_same_type(), sheaf::filtered_depth_first_member_iterator::item(), sheaf::filtered_depth_first_member_iterator::item_is_ancestor_of(), sheaf::subposet::name(), sheaf::read_write_monitor_handle::state_is_read_accessible(), sheaf::filtered_depth_first_member_iterator::strict(), truncate(), and sheaf::poset_component::version_name().

Member Function Documentation

◆ clone()

sheaf::preorder_member_iterator * sheaf::preorder_member_iterator::clone ( ) const
virtual

Make a new instance of the same type as this.

Postcondition
  • result != 0

Implements sheaf::filtered_depth_first_member_iterator.

Definition at line 167 of file preorder_member_iterator.cc.

References invariant(), and preorder_member_iterator().

Referenced by is_ancestor_of().

◆ invariant()

◆ is_ancestor_of()

bool sheaf::preorder_member_iterator::is_ancestor_of ( const any other) const
virtual

True if other conforms to this.

Reimplemented from sheaf::filtered_depth_first_member_iterator.

Definition at line 147 of file preorder_member_iterator.cc.

References clone().

Referenced by operator=(), and ~preorder_member_iterator().

◆ operator=() [1/2]

◆ operator=() [2/2]

sheaf::preorder_member_iterator & sheaf::preorder_member_iterator::operator= ( const preorder_member_iterator xother)

Assignment operator.

Precondition
  • is_ancestor_of(&xother)
Not Implemented.
Postcondition

Definition at line 107 of file preorder_member_iterator.cc.

References invariant(), is_ancestor_of(), and ~preorder_member_iterator().

◆ truncate()

void sheaf::preorder_member_iterator::truncate ( )

Makes this the next member of the subset which is not less than old this, i.e. the depth-first descent is truncated and the cover of this is not visited.

Precondition
  • !is_done()

Definition at line 407 of file preorder_member_iterator.cc.

References sheaf::filtered_depth_first_member_iterator::_iterator, sheaf::filtered_depth_first_member_iterator::is_done(), sheaf::filtered_depth_first_member_iterator::is_initialized(), sheaf::depth_first_iterator::truncate(), and sheaf::filtered_depth_first_member_iterator::update_item().

Referenced by preorder_member_iterator().


The documentation for this class was generated from the following files: