SheafSystem  0.0.0.0
sheaf::filtered_depth_first_member_iterator Class Referenceabstract

#include <filtered_depth_first_member_iterator.h>

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

Public Member Functions

 filtered_depth_first_member_iterator (const filtered_depth_first_member_iterator &xother)
 Copy constructor. More...
 
virtual filtered_depth_first_member_iteratoroperator= (const filtered_depth_first_member_iterator &xother)
 Assignment operator. More...
 
virtual ~filtered_depth_first_member_iterator ()
 Destructor. More...
 
virtual bool is_ancestor_of (const any *other) const
 True if other conforms to this. More...
 
virtual filtered_depth_first_member_iteratorclone () const =0
 Make a new instance of the same type as this. More...
 
bool invariant () const
 The class invariant. 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...
 

Protected Member Functions

 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

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 postorder 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 48 of file filtered_depth_first_member_iterator.h.

Constructor & Destructor Documentation

◆ filtered_depth_first_member_iterator() [1/2]

sheaf::filtered_depth_first_member_iterator::filtered_depth_first_member_iterator ( const filtered_depth_first_member_iterator xother)

Copy constructor.

Postcondition
  • -unexecutable( this is first member of iteration or is_done() )

Definition at line 37 of file filtered_depth_first_member_iterator.cc.

References _item, _iterator, anchor(), sheaf::filtered_depth_first_iterator::clone(), sheaf::abstract_poset_member::clone(), descending(), filter(), invariant(), is_done(), is_initialized(), sheaf::any::is_same_type(), item(), operator=(), and strict().

◆ ~filtered_depth_first_member_iterator()

sheaf::filtered_depth_first_member_iterator::~filtered_depth_first_member_iterator ( )
virtual

◆ filtered_depth_first_member_iterator() [2/2]

sheaf::filtered_depth_first_member_iterator::filtered_depth_first_member_iterator ( filtered_depth_first_iterator xitr,
abstract_poset_member xitem 
)
protected

Covariant constructor; supports virtual construction of data members.

Precondition
  • xitr != 0
  • xitem != 0
Postcondition
  • _iterator == xitr
  • _item == xitem
  • !is_done() == item().is_attached()

Definition at line 931 of file filtered_depth_first_member_iterator.cc.

References _item, _iterator, is_done(), item(), and update_item().

Member Function Documentation

◆ anchor() [1/2]

◆ anchor() [2/2]

const sheaf::abstract_poset_member & sheaf::filtered_depth_first_member_iterator::anchor ( ) const
virtual

The poset member whose downset is being iterated over; the top member of the domain of iteration (const version).

Precondition

Definition at line 252 of file filtered_depth_first_member_iterator.cc.

References _iterator, sheaf::depth_first_iterator::anchor(), is_initialized(), and put_anchor().

◆ anchor_is_ancestor_of()

bool sheaf::filtered_depth_first_member_iterator::anchor_is_ancestor_of ( const abstract_poset_member xmbr) const
virtual

True if xmbr conforms to the type of anchor of this.

Definition at line 908 of file filtered_depth_first_member_iterator.cc.

Referenced by item_is_ancestor_of().

◆ clone()

virtual filtered_depth_first_member_iterator* sheaf::filtered_depth_first_member_iterator::clone ( ) const
pure virtual

Make a new instance of the same type as this.

Reimplemented from sheaf::any.

Implemented in sheaf::postorder_member_iterator, and sheaf::preorder_member_iterator.

◆ ct()

int sheaf::filtered_depth_first_member_iterator::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.

Precondition
  • xreset ? anchor().state_is_read_accessible(): true
Postcondition
  • result >= 0

Definition at line 661 of file filtered_depth_first_member_iterator.cc.

References _iterator, anchor(), sheaf::depth_first_iterator::ct(), has_visited(), is_done(), is_initialized(), and update_item().

Referenced by reset().

◆ descending()

◆ filter()

◆ greater_index()

const sheaf::scoped_index & sheaf::filtered_depth_first_member_iterator::greater_index ( ) const

The index of the greater member of the current link.

Precondition

Definition at line 799 of file filtered_depth_first_member_iterator.cc.

References _iterator, sheaf::depth_first_iterator::greater_index(), is_initialized(), and lesser_index().

Referenced by put_has_visited().

◆ has_visited() [1/3]

bool sheaf::filtered_depth_first_member_iterator::has_visited ( pod_index_type  xhub_id) const

True if this has already visited member with hub id xhub_id.

Precondition
  • anchor().host()->contains_member(xhub_id)

Definition at line 687 of file filtered_depth_first_member_iterator.cc.

References _iterator, anchor(), sheaf::depth_first_iterator::has_visited(), and is_initialized().

Referenced by ct(), has_visited(), and put_has_visited().

◆ has_visited() [2/3]

bool sheaf::filtered_depth_first_member_iterator::has_visited ( const scoped_index xid) const

True if this has already visited member with id xid.

Precondition

Definition at line 710 of file filtered_depth_first_member_iterator.cc.

References anchor(), has_visited(), sheaf::scoped_index::hub_pod(), and is_initialized().

◆ has_visited() [3/3]

bool sheaf::filtered_depth_first_member_iterator::has_visited ( const abstract_poset_member xmbr) const

True if this has already visited member xmbr.

Precondition
  • xmbr.is_attached()
  • anchor().host()->is_same_state(xmbr.host())

Definition at line 727 of file filtered_depth_first_member_iterator.cc.

References _iterator, anchor(), sheaf::depth_first_iterator::has_visited(), sheaf::poset_component::host(), sheaf::poset_component::is_attached(), is_initialized(), and put_has_visited().

◆ invariant()

◆ is_ancestor_of()

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

True if other conforms to this.

Reimplemented from sheaf::any.

Reimplemented in sheaf::postorder_member_iterator, and sheaf::preorder_member_iterator.

Definition at line 132 of file filtered_depth_first_member_iterator.cc.

References invariant().

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

◆ is_done()

◆ is_initialized()

◆ item() [1/2]

◆ item() [2/2]

const sheaf::abstract_poset_member & sheaf::filtered_depth_first_member_iterator::item ( ) const

The the current member of the iteration (const version).

Precondition

Definition at line 862 of file filtered_depth_first_member_iterator.cc.

References _item, is_initialized(), and item_is_ancestor_of().

◆ item_is_ancestor_of()

bool sheaf::filtered_depth_first_member_iterator::item_is_ancestor_of ( const abstract_poset_member xmbr) const
virtual

◆ lesser_index()

const sheaf::scoped_index & sheaf::filtered_depth_first_member_iterator::lesser_index ( ) const

The index of the lesser member of the current link lesser_index() == index()

Precondition
Postcondition

Definition at line 818 of file filtered_depth_first_member_iterator.cc.

References _iterator, is_initialized(), item(), and sheaf::depth_first_iterator::lesser_index().

Referenced by greater_index().

◆ next()

void sheaf::filtered_depth_first_member_iterator::next ( )
virtual

Makes this the next member of the iteration.

Precondition
  • !is_done()
Postcondition
  • !is_done() == item().is_attached()

Definition at line 600 of file filtered_depth_first_member_iterator.cc.

References _iterator, invariant(), is_done(), is_initialized(), item(), sheaf::depth_first_iterator::next(), reset(), and update_item().

Referenced by is_done().

◆ operator=()

sheaf::filtered_depth_first_member_iterator & sheaf::filtered_depth_first_member_iterator::operator= ( const filtered_depth_first_member_iterator xother)
virtual

Assignment operator.

Precondition
  • is_ancestor_of(&xother)
Postcondition
  • -unexecutable( this is first member of iteration or is_done() )

Reimplemented in sheaf::postorder_member_iterator, and sheaf::preorder_member_iterator.

Definition at line 68 of file filtered_depth_first_member_iterator.cc.

References _item, _iterator, anchor(), sheaf::filtered_depth_first_iterator::clone(), sheaf::abstract_poset_member::clone(), descending(), sheaf::poset_component::detach_from_state(), filter(), invariant(), is_ancestor_of(), is_done(), is_initialized(), sheaf::any::is_same_type(), item(), strict(), and ~filtered_depth_first_member_iterator().

Referenced by filtered_depth_first_member_iterator(), sheaf::preorder_member_iterator::operator=(), and sheaf::postorder_member_iterator::operator=().

◆ order()

sheaf::depth_first_iterator::order_type sheaf::filtered_depth_first_member_iterator::order ( )

Iteration directions.

The order of the iteration. Determines which actions are exported to the client.

Precondition

Definition at line 185 of file filtered_depth_first_member_iterator.cc.

References _iterator, is_initialized(), and sheaf::depth_first_iterator::order().

Referenced by invariant().

◆ put_anchor() [1/3]

void sheaf::filtered_depth_first_member_iterator::put_anchor ( const abstract_poset_member xanchor)
virtual

Set anchor() to *xanchor.

Precondition
  • xanchor!=0
Postcondition
  • anchor().version() == xanchor->version()

Definition at line 273 of file filtered_depth_first_member_iterator.cc.

References _iterator, anchor(), descending(), filter(), invariant(), is_done(), is_initialized(), sheaf::any::is_same_type(), sheaf::filtered_depth_first_iterator::put_anchor(), strict(), update_item(), and sheaf::poset_component::version().

Referenced by anchor(), and put_anchor().

◆ put_anchor() [2/3]

void sheaf::filtered_depth_first_member_iterator::put_anchor ( pod_index_type  xanchor_hub_id)
virtual

◆ put_anchor() [3/3]

void sheaf::filtered_depth_first_member_iterator::put_anchor ( const scoped_index xanchor_id)

Set anchor() to member at xanchor_id.

Precondition
Postcondition

Definition at line 333 of file filtered_depth_first_member_iterator.cc.

References anchor(), filter(), sheaf::scoped_index::hub_pod(), invariant(), is_done(), is_initialized(), and put_anchor().

◆ put_descending()

void sheaf::filtered_depth_first_member_iterator::put_descending ( bool  xdescending)

Set descending() to xdescending.

Postcondition

Definition at line 517 of file filtered_depth_first_member_iterator.cc.

References _iterator, descending(), sheaf::filtered_depth_first_iterator::put_descending(), and strict().

Referenced by descending().

◆ put_filter() [1/4]

void sheaf::filtered_depth_first_member_iterator::put_filter ( const subposet filter)

Sets the subposet which is the filter.

Precondition
  • anchor().host()->includes_subposet(&xfilter)
Postcondition

Definition at line 375 of file filtered_depth_first_member_iterator.cc.

References _iterator, anchor(), descending(), filter(), invariant(), is_done(), is_initialized(), sheaf::filtered_depth_first_iterator::put_filter(), strict(), and update_item().

Referenced by filter(), and put_filter().

◆ put_filter() [2/4]

void sheaf::filtered_depth_first_member_iterator::put_filter ( const std::string &  xfilter_name)

Sets the subposet which is the filter.

Precondition
  • !xfilter_name.empty() ? anchor().host()->includes_subposet(xfilter_name) : true
Postcondition

Definition at line 406 of file filtered_depth_first_member_iterator.cc.

References _iterator, anchor(), descending(), filter(), sheaf::poset_component::host(), sheaf::poset_state_handle::includes_subposet(), invariant(), is_done(), is_initialized(), sheaf::subposet::name(), put_filter(), sheaf::filtered_depth_first_iterator::put_filter(), strict(), update_item(), and sheaf::poset_component::version_name().

◆ put_filter() [3/4]

void sheaf::filtered_depth_first_member_iterator::put_filter ( pod_index_type  xfilter_hub_id)

Sets the subposet which is the filter.

Precondition
  • anchor().host()->includes_subposet(xfilter_hub_id)
Postcondition

Definition at line 439 of file filtered_depth_first_member_iterator.cc.

References _iterator, anchor(), descending(), filter(), invariant(), is_done(), is_initialized(), put_filter(), sheaf::filtered_depth_first_iterator::put_filter(), strict(), and update_item().

◆ put_filter() [4/4]

void sheaf::filtered_depth_first_member_iterator::put_filter ( const scoped_index xfilter_id)

Sets the subposet which is the filter.

Precondition
  • anchor().host()->includes_subposet(xfilter_id)
Postcondition

Definition at line 470 of file filtered_depth_first_member_iterator.cc.

References anchor(), descending(), filter(), sheaf::scoped_index::hub_pod(), invariant(), is_done(), is_initialized(), put_filter(), and strict().

◆ put_has_visited() [1/2]

void sheaf::filtered_depth_first_member_iterator::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.

Precondition
  • anchor().host()->contains_member(xhub_id)
Postcondition
  • has_visited(xhub_id) == xvalue

Definition at line 751 of file filtered_depth_first_member_iterator.cc.

References _iterator, anchor(), has_visited(), is_initialized(), and sheaf::depth_first_iterator::put_has_visited().

Referenced by has_visited(), and put_has_visited().

◆ put_has_visited() [2/2]

void sheaf::filtered_depth_first_member_iterator::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.

Precondition
Postcondition
  • has_visited(xid) == xvalue

Definition at line 775 of file filtered_depth_first_member_iterator.cc.

References anchor(), greater_index(), has_visited(), sheaf::scoped_index::hub_pod(), is_initialized(), and put_has_visited().

◆ put_strict()

void sheaf::filtered_depth_first_member_iterator::put_strict ( bool  xstrict)

Set strict() to xstrict.

Postcondition

Definition at line 557 of file filtered_depth_first_member_iterator.cc.

References _iterator, is_done(), sheaf::filtered_depth_first_iterator::put_strict(), and strict().

Referenced by strict().

◆ reset()

void sheaf::filtered_depth_first_member_iterator::reset ( bool  xreset_markers = RESET)
virtual

Restarts the iteration.

Precondition
Postcondition
  • anchor().version() == old_anchor_version
  • item().is_attached() == !is_done()

Definition at line 626 of file filtered_depth_first_member_iterator.cc.

References _iterator, anchor(), ct(), descending(), filter(), invariant(), is_done(), is_initialized(), item(), sheaf::depth_first_iterator::reset(), strict(), and update_item().

Referenced by next().

◆ strict()

◆ update_item()

void sheaf::filtered_depth_first_member_iterator::update_item ( )
protectedvirtual

Member Data Documentation

◆ _item

abstract_poset_member* sheaf::filtered_depth_first_member_iterator::_item
protected

The member handle for the current item in the iteration.

Definition at line 309 of file filtered_depth_first_member_iterator.h.

Referenced by filtered_depth_first_member_iterator(), invariant(), item(), operator=(), update_item(), and ~filtered_depth_first_member_iterator().

◆ _iterator


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