SheafSystem  0.0.0.0
fiber_bundle::section_dof_iterator Class Referenceabstract

Iterates in postorder over dofs of a schema member anchor. Attaches an a handle of type section_space_schema_member to the current member of the iteration. More...

#include <section_dof_iterator.h>

Inheritance diagram for fiber_bundle::section_dof_iterator:
sheaf::poset_dof_iterator sheaf::poset_dof_iterator sheaf::any sheaf::any fiber_bundle::binary_section_dof_iterator fiber_bundle::product_section_dof_iterator

Public Member Functions

virtual section_dof_iteratoroperator= (const poset_dof_iterator &xother)
 Assignment operator. More...
 
section_dof_iteratoroperator= (const section_dof_iterator &xother)
 Assignment operator. More...
 
virtual ~section_dof_iterator ()
 Destructor. More...
 
virtual bool is_ancestor_of (const any *other) const
 True if other conforms to this. More...
 
virtual section_dof_iteratorclone () const =0
 Make a new instance of the same type as this. More...
 
virtual bool invariant () const
 The class invariant. More...
 
virtual bool is_initialized () const
 True if this has been initialized for iteration with respect to a specific anchor. More...
 
section_space_schema_memberanchor ()
 The schema member whose downset is being iterated over; the top member of the domain of iteration (mutable version). More...
 
const section_space_schema_memberanchor () const
 The schema member whose downset is being iterated over; the top member of the domain of iteration (const version). More...
 
virtual void put_anchor (const schema_poset_member *xanchor, int xversion)
 Set anchor() to xversion of *xanchor. More...
 
virtual bool is_done () const
 True if iteration finished. More...
 
virtual void force_is_done ()
 Force the iterator to be done. More...
 
virtual void next ()
 Makes this the next member of the subset. More...
 
virtual void reset (bool xreset_markers=RESET)
 Restarts the iteration over the down set of anchor() If xreset_markers, set !has_visited for all members. More...
 
virtual 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...
 
virtual bool has_visited (pod_index_type xhub_id) const
 True if this has already visited hub id xhub_id. More...
 
virtual bool has_visited (const schema_poset_member &xmbr) const
 True if this has already visited xmbr. More...
 
virtual void put_has_visited (pod_index_type xhub_id, bool xvalue)
 Set the visisted marker for hub id xhub_id to xvalue. Intended for use reseting iterator without having to reset entire collection of markers. More...
 
section_space_schema_memberitem ()
 The current member of the iteration (mutable version). More...
 
const section_space_schema_memberitem () const
 The current member of the iteration (const version). More...
 
virtual bool item_is_ancestor_of (const schema_poset_member &xmbr) const
 True if xmbr conforms to the type of item of this. More...
 
virtual section_dof_iteratoroperator= (const poset_dof_iterator &xother)
 Assignment operator. More...
 
section_dof_iteratoroperator= (const section_dof_iterator &xother)
 Assignment operator. More...
 
virtual ~section_dof_iterator ()
 Destructor. More...
 
virtual bool is_ancestor_of (const any *other) const
 True if other conforms to this. More...
 
virtual section_dof_iteratorclone () const =0
 Make a new instance of the same type as this. More...
 
virtual bool invariant () const
 The class invariant. More...
 
section_space_schema_memberanchor ()
 The schema member whose downset is being iterated over; the top member of the domain of iteration (mutable version). More...
 
const section_space_schema_memberanchor () const
 The schema member whose downset is being iterated over; the top member of the domain of iteration (const version). More...
 
section_space_schema_memberitem ()
 The current member of the iteration (mutable version). More...
 
const section_space_schema_memberitem () const
 The current member of the iteration (const version). More...
 
virtual bool item_is_ancestor_of (const schema_poset_member &xmbr) const
 True if xmbr conforms to the type of item of this. More...
 
- Public Member Functions inherited from sheaf::poset_dof_iterator
 poset_dof_iterator ()
 Default constructor; creates an unattached iterator, with and all-pass filter. More...
 
 poset_dof_iterator (const poset_dof_iterator &xother)
 Copy constructor. More...
 
virtual ~poset_dof_iterator ()
 Destructor. More...
 
 poset_dof_iterator (const schema_poset_member &xanchor, bool xis_table_dof=false, int xversion=ANCHOR_VERSION)
 Creates an iterator over the table dofs (is_table_dof true) or row dofs (xis_table_dof false) of version xversion in schema xanchor. "Explicit" prevents interpretation as conversion from schema_poset_member. More...
 
schema_poset_memberanchor ()
 The schema member whose downset is being iterated over; the top member of the domain of iteration (mutable version). More...
 
const schema_poset_memberanchor () const
 The schema member whose downset is being iterated over; the top member of the domain of iteration (const version). More...
 
virtual void put_anchor (pod_index_type xindex)
 Set anchor() to the member with hub id xhub_id in host(). Does not change version; does not force reset of markers. More...
 
void put_anchor (const scoped_index &xid)
 Set anchor() to the member with id xid in host(). Does not change version; does not force reset of markers. More...
 
bool has_visited (const scoped_index &xindex) const
 True if this has already visited id xid. 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...
 
schema_poset_memberitem ()
 The current member of the iteration (mutable version). More...
 
const schema_poset_memberitem () const
 The current member of the iteration (const version). More...
 
virtual const scoped_indexindex ()
 The index of the current member of the iteration. More...
 
bool is_table_dof () const
 True if iterating over table dofs. 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

 section_dof_iterator ()
 Default constructor; creates an unattached iterator. Protected because this class is abstract. More...
 
 section_dof_iterator (const section_dof_iterator &xother)
 Copy constructor; attaches this to the same anchor as xother. Protected because this class is abstract. More...
 
virtual void reset_item ()=0
 Creates item if needed and attaches it to the current index. Abstract in this class; intended to be redefined in descendants. More...
 
virtual void update_item ()=0
 Attaches the item handle to the current index, or detaches the item handle if is_done. More...
 
 section_dof_iterator ()
 Default constructor; creates an unattached iterator. Protected because this class is abstract. More...
 
 section_dof_iterator (const section_dof_iterator &xother)
 Copy constructor; attaches this to the same anchor as xother. Protected because this class is abstract. More...
 
 section_dof_iterator (const section_space_schema_member &xanchor, bool xis_table_dof=false, int xversion=ANCHOR_VERSION)
 Creates an iterator over the table dofs (xis_table_dof == true) or rows dofs (xis_table_dof = false) of refinemement level xversion of schema xanchor. "Explicit" prevents interpretation as conversion from section_space_schema_member. More...
 
virtual void reset_item ()=0
 Creates item if needed and attaches it to the current index. Abstract in this class; intended to be redefined in descendants. More...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 

Protected Attributes

depth_first_iterator_discretization_itr
 The discretization iterator. More...
 
- Protected Attributes inherited from sheaf::poset_dof_iterator
schema_poset_member_anchor
 The schema member whose downset is being iterated over; the top member of the domain of iteration. More...
 
schema_poset_member_item
 The member handle for the current item in the iteration. More...
 
postorder_iterator _itr
 The index iterator used to implement the iteration. More...
 
bool _is_table_dof
 True if iterating over table dofs. More...
 

Additional Inherited Members

- Public Types inherited from sheaf::poset_dof_iterator
enum  anchor_version_index { ANCHOR_VERSION = CURRENT_MEMBER_VERSION, ANCHOR_HOST_VERSION = CURRENT_HOST_VERSION }
 Identifiers for anchor version. More...
 

Detailed Description

Iterates in postorder over dofs of a schema member anchor. Attaches an a handle of type section_space_schema_member to the current member of the iteration.

Definition at line 50 of file section_dof_iterator.h.

Constructor & Destructor Documentation

◆ ~section_dof_iterator() [1/2]

fiber_bundle::section_dof_iterator::~section_dof_iterator ( )
virtual

Destructor.

Definition at line 98 of file section_dof_iterator.cc.

References is_ancestor_of().

Referenced by operator=().

◆ section_dof_iterator() [1/5]

fiber_bundle::section_dof_iterator::section_dof_iterator ( )
protected

Default constructor; creates an unattached iterator. Protected because this class is abstract.

Postcondition
  • !is_initialized()

Definition at line 618 of file section_dof_iterator.cc.

References _discretization_itr, invariant(), and is_initialized().

Referenced by item_is_ancestor_of().

◆ section_dof_iterator() [2/5]

fiber_bundle::section_dof_iterator::section_dof_iterator ( const section_dof_iterator xother)
protected

Copy constructor; attaches this to the same anchor as xother. Protected because this class is abstract.

Postcondition

Definition at line 640 of file section_dof_iterator.cc.

References _discretization_itr, sheaf::poset_dof_iterator::_itr, anchor(), sheaf::depth_first_iterator::clone(), invariant(), is_initialized(), sheaf::any::is_same_type(), sheaf::poset_dof_iterator::is_table_dof(), item(), and sheaf::poset_component::version().

◆ ~section_dof_iterator() [2/2]

virtual fiber_bundle::section_dof_iterator::~section_dof_iterator ( )
virtual

Destructor.

◆ section_dof_iterator() [3/5]

fiber_bundle::section_dof_iterator::section_dof_iterator ( )
protected

Default constructor; creates an unattached iterator. Protected because this class is abstract.

◆ section_dof_iterator() [4/5]

fiber_bundle::section_dof_iterator::section_dof_iterator ( const section_dof_iterator xother)
protected

Copy constructor; attaches this to the same anchor as xother. Protected because this class is abstract.

◆ section_dof_iterator() [5/5]

fiber_bundle::section_dof_iterator::section_dof_iterator ( const section_space_schema_member xanchor,
bool  xis_table_dof = false,
int  xversion = ANCHOR_VERSION 
)
explicitprotected

Creates an iterator over the table dofs (xis_table_dof == true) or rows dofs (xis_table_dof = false) of refinemement level xversion of schema xanchor. "Explicit" prevents interpretation as conversion from section_space_schema_member.

Precondition
  • item_is_ancestor_of(xanchor)
  • xanchor.state_is_read_accessible()
  • xanchor.host()->is_schematized(false)
  • xanchor.has_version(xversion)
Postcondition
  • anchor().version() == xanchor.unaliased_version(xversion)
  • -unexecutable( !is_done() implies this is first member )
  • item().is_attached() == !is_done()

Definition at line 292 of file section_dof_iterator_2.cc.

References anchor(), sheaf::poset_component::has_version(), fiber_bundle::section_space_schema_member::host(), invariant(), is_done(), is_initialized(), sheaf::any::is_same_type(), fiber_bundle::section_space_schema_poset::is_schematized(), item(), item_is_ancestor_of(), sheaf::read_write_monitor_handle::state_is_read_accessible(), and sheaf::poset_component::unaliased_version().

Member Function Documentation

◆ anchor() [1/4]

section_space_schema_member& fiber_bundle::section_dof_iterator::anchor ( )

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

◆ anchor() [2/4]

const section_space_schema_member& fiber_bundle::section_dof_iterator::anchor ( ) const

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

◆ anchor() [3/4]

fiber_bundle::section_space_schema_member & fiber_bundle::section_dof_iterator::anchor ( )

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

Precondition

Definition at line 191 of file section_dof_iterator.cc.

Referenced by is_initialized(), and section_dof_iterator().

◆ anchor() [4/4]

const fiber_bundle::section_space_schema_member & fiber_bundle::section_dof_iterator::anchor ( ) const

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

Precondition

Definition at line 211 of file section_dof_iterator.cc.

References put_anchor().

◆ clone() [1/2]

virtual section_dof_iterator* fiber_bundle::section_dof_iterator::clone ( ) const
pure virtual

Make a new instance of the same type as this.

Reimplemented from sheaf::poset_dof_iterator.

Implemented in fiber_bundle::binary_section_dof_iterator, and fiber_bundle::product_section_dof_iterator.

◆ clone() [2/2]

virtual section_dof_iterator* fiber_bundle::section_dof_iterator::clone ( ) const
pure virtual

Make a new instance of the same type as this.

Reimplemented from sheaf::poset_dof_iterator.

Implemented in fiber_bundle::binary_section_dof_iterator, and fiber_bundle::product_section_dof_iterator.

◆ ct()

int fiber_bundle::section_dof_iterator::ct ( bool  xreset = false)
virtual

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

Reimplemented from sheaf::poset_dof_iterator.

Definition at line 450 of file section_dof_iterator.cc.

References has_visited().

Referenced by reset().

◆ force_is_done()

void fiber_bundle::section_dof_iterator::force_is_done ( )
virtual

Force the iterator to be done.

Precondition
Issue:
the above requirement is probably a symptom of bad design. Either is_done should not be virtual or this class should not inherit poset_dof_iterator, because poset_dof_iterator::force_is_done has no way to actually ensure the virtual is_done postcondition.
Postcondition

Reimplemented from sheaf::poset_dof_iterator.

Definition at line 333 of file section_dof_iterator.cc.

References next().

Referenced by is_done().

◆ has_visited() [1/2]

bool fiber_bundle::section_dof_iterator::has_visited ( pod_index_type  xhub_id) const
virtual

True if this has already visited hub id xhub_id.

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

Reimplemented from sheaf::poset_dof_iterator.

Definition at line 476 of file section_dof_iterator.cc.

Referenced by ct().

◆ has_visited() [2/2]

bool fiber_bundle::section_dof_iterator::has_visited ( const schema_poset_member xmbr) const
virtual

True if this has already visited xmbr.

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

Reimplemented from sheaf::poset_dof_iterator.

Definition at line 500 of file section_dof_iterator.cc.

References fiber_bundle::section_space_schema_member::base_space_id(), fiber_bundle::section_space_schema_member::fiber_schema_id(), sheaf::poset_component::host(), sheaf::poset_component::is_attached(), and put_has_visited().

◆ invariant() [1/2]

virtual bool fiber_bundle::section_dof_iterator::invariant ( ) const
virtual

◆ invariant() [2/2]

◆ is_ancestor_of() [1/2]

virtual bool fiber_bundle::section_dof_iterator::is_ancestor_of ( const any other) const
virtual

True if other conforms to this.

Reimplemented from sheaf::poset_dof_iterator.

Reimplemented in fiber_bundle::binary_section_dof_iterator, and fiber_bundle::product_section_dof_iterator.

◆ is_ancestor_of() [2/2]

bool fiber_bundle::section_dof_iterator::is_ancestor_of ( const any other) const
virtual

True if other conforms to this.

Reimplemented from sheaf::poset_dof_iterator.

Reimplemented in fiber_bundle::binary_section_dof_iterator, and fiber_bundle::product_section_dof_iterator.

Definition at line 121 of file section_dof_iterator.cc.

References invariant().

Referenced by ~section_dof_iterator().

◆ is_done()

◆ is_initialized()

◆ item() [1/4]

section_space_schema_member& fiber_bundle::section_dof_iterator::item ( )

The current member of the iteration (mutable version).

◆ item() [2/4]

const section_space_schema_member& fiber_bundle::section_dof_iterator::item ( ) const

The current member of the iteration (const version).

◆ item() [3/4]

fiber_bundle::section_space_schema_member & fiber_bundle::section_dof_iterator::item ( )

The current member of the iteration (mutable version).

Precondition

Definition at line 555 of file section_dof_iterator.cc.

Referenced by put_has_visited(), and section_dof_iterator().

◆ item() [4/4]

const fiber_bundle::section_space_schema_member & fiber_bundle::section_dof_iterator::item ( ) const

The current member of the iteration (const version).

Precondition

Definition at line 575 of file section_dof_iterator.cc.

References item_is_ancestor_of().

◆ item_is_ancestor_of() [1/2]

virtual bool fiber_bundle::section_dof_iterator::item_is_ancestor_of ( const schema_poset_member xmbr) const
virtual

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

Reimplemented from sheaf::poset_dof_iterator.

Reimplemented in fiber_bundle::binary_section_dof_iterator, and fiber_bundle::product_section_dof_iterator.

◆ item_is_ancestor_of() [2/2]

bool fiber_bundle::section_dof_iterator::item_is_ancestor_of ( const schema_poset_member xmbr) const
virtual

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

Reimplemented from sheaf::poset_dof_iterator.

Reimplemented in fiber_bundle::binary_section_dof_iterator, and fiber_bundle::product_section_dof_iterator.

Definition at line 595 of file section_dof_iterator.cc.

References section_dof_iterator().

Referenced by item(), and section_dof_iterator().

◆ next()

void fiber_bundle::section_dof_iterator::next ( )
virtual

Makes this the next member of the subset.

Precondition
  • !is_done()
Postcondition
  • !is_done() == item().is_attached()
  • -unexecutable( postorder - have visited all of the members of the strict down set of item() )

Reimplemented from sheaf::poset_dof_iterator.

Definition at line 365 of file section_dof_iterator.cc.

References reset().

Referenced by force_is_done(), fiber_bundle::sparse_field_dof_map::get_dof_tuple(), and fiber_bundle::sparse_field_dof_map::put_dof_tuple().

◆ operator=() [1/4]

virtual section_dof_iterator& fiber_bundle::section_dof_iterator::operator= ( const poset_dof_iterator xother)
virtual

◆ operator=() [2/4]

section_dof_iterator& fiber_bundle::section_dof_iterator::operator= ( const section_dof_iterator xother)

Assignment operator.

◆ operator=() [3/4]

fiber_bundle::section_dof_iterator & fiber_bundle::section_dof_iterator::operator= ( const poset_dof_iterator xother)
virtual

Assignment operator.

Precondition
  • is_ancestor_of(&xother)
  • xother.is_done()
Postcondition

Reimplemented from sheaf::poset_dof_iterator.

Reimplemented in fiber_bundle::binary_section_dof_iterator, and fiber_bundle::product_section_dof_iterator.

Definition at line 34 of file section_dof_iterator.cc.

References _discretization_itr, sheaf::poset_dof_iterator::_itr, sheaf::poset_dof_iterator::anchor(), sheaf::depth_first_iterator::clone(), sheaf::poset_dof_iterator::is_done(), is_initialized(), sheaf::poset_dof_iterator::is_initialized(), sheaf::poset_dof_iterator::is_table_dof(), sheaf::poset_dof_iterator::item(), and sheaf::poset_component::version().

◆ operator=() [4/4]

fiber_bundle::section_dof_iterator & fiber_bundle::section_dof_iterator::operator= ( const section_dof_iterator xother)

Assignment operator.

Precondition
  • is_ancestor_of(&xother)
Not Implemented.
Postcondition

Definition at line 76 of file section_dof_iterator.cc.

References ~section_dof_iterator().

◆ put_anchor()

◆ put_has_visited()

void fiber_bundle::section_dof_iterator::put_has_visited ( pod_index_type  xhub_id,
bool  xvalue 
)
virtual

Set the visisted 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

Reimplemented from sheaf::poset_dof_iterator.

Definition at line 528 of file section_dof_iterator.cc.

References item().

Referenced by has_visited().

◆ reset()

void fiber_bundle::section_dof_iterator::reset ( bool  xreset_markers = RESET)
virtual

Restarts the iteration over the down set of anchor() If xreset_markers, set !has_visited for all members.

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

Reimplemented from sheaf::poset_dof_iterator.

Definition at line 409 of file section_dof_iterator.cc.

References ct().

Referenced by fiber_bundle::binary_section_dof_iterator::initialize(), next(), and fiber_bundle::product_section_dof_iterator::product_section_dof_iterator().

◆ reset_item() [1/2]

virtual void fiber_bundle::section_dof_iterator::reset_item ( )
protectedpure virtual

Creates item if needed and attaches it to the current index. Abstract in this class; intended to be redefined in descendants.

Reimplemented from sheaf::poset_dof_iterator.

Implemented in fiber_bundle::binary_section_dof_iterator, and fiber_bundle::product_section_dof_iterator.

◆ reset_item() [2/2]

virtual void fiber_bundle::section_dof_iterator::reset_item ( )
protectedpure virtual

Creates item if needed and attaches it to the current index. Abstract in this class; intended to be redefined in descendants.

Reimplemented from sheaf::poset_dof_iterator.

Implemented in fiber_bundle::binary_section_dof_iterator, and fiber_bundle::product_section_dof_iterator.

◆ update_item()

virtual void fiber_bundle::section_dof_iterator::update_item ( )
protectedpure virtual

Attaches the item handle to the current index, or detaches the item handle if is_done.

Reimplemented from sheaf::poset_dof_iterator.

Implemented in fiber_bundle::binary_section_dof_iterator.

Referenced by fiber_bundle::product_section_dof_iterator::reset_item().

Member Data Documentation

◆ _discretization_itr

depth_first_iterator* fiber_bundle::section_dof_iterator::_discretization_itr
protected

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