SheafSystem  0.0.0.0
sheaf::offset_index_space_iterator Class Reference

An iterator over a gathered id space in which the equivlence between the ids in the space and the hub id space is computed using an offset. More...

#include <offset_index_space_iterator.h>

Inheritance diagram for sheaf::offset_index_space_iterator:
sheaf::explicit_index_space_iterator sheaf::index_space_iterator sheaf::any

Friends

class offset_index_space_state
 

OFFSET_INDEX_SPACE_ITERATOR FACET

pod_type _offset
 The offset into the hub id space. More...
 
size_type _ct
 The number of entries to iterate over. More...
 
 offset_index_space_iterator ()
 Default constructor. More...
 
 offset_index_space_iterator (const offset_index_space_iterator &xother)
 Copy constructor. More...
 
 offset_index_space_iterator (const index_space_family &xid_spaces, pod_type xindex)
 Constructor: Attach to state with index xindex in the family xid_spaces. More...
 
 offset_index_space_iterator (const index_space_family &xid_spaces, const std::string &xname)
 Constructor: Attach to state with name xname in the family xid_spaces. More...
 
offset_index_space_iteratoroperator= (const offset_index_space_iterator &xother)
 Assignment operator. More...
 
virtual ~offset_index_space_iterator ()
 Destructor. More...
 
pod_type offset () const
 The offset into the hub id space. More...
 
size_type ct () const
 The number of entries to iterate over. More...
 

INDEX_SPACE_ITERATOR FACET

virtual offset_index_space_iteratoroperator= (const index_space_iterator &xother)
 Assignment operator. More...
 
virtual bool operator== (const index_space_iterator &xother) const
 True if this is equivalent to xother. More...
 
virtual offset_index_space_iteratorclone () const
 Virtual constructor, makes a new instance of the same type as this. If the iterator is attached, attach to the same state. More...
 

ITERATOR FACET

virtual void next ()
 Makes item() the next id in the iteration. More...
 
virtual void reset ()
 Restarts the iteration. More...
 

HANDLE FACET

virtual void attach_to (explicit_index_space_state *xstate)
 Attach to the explicit id space state xstate. More...
 
virtual bool conforms_to_state (explicit_index_space_state *xstate) const
 True if this conforms to the iterator type required by the explicit id space state xstate. More...
 

ANY FACET

virtual bool is_ancestor_of (const any *other) const
 Conformance test; true if other conforms to this. More...
 
virtual bool invariant () const
 Class invariant. More...
 

Additional Inherited Members

- Public Types inherited from sheaf::index_space_iterator
typedef pod_index_type pod_type
 The "plain old data" index type for this. More...
 
- Public Member Functions inherited from sheaf::explicit_index_space_iterator
virtual ~explicit_index_space_iterator ()
 Destructor. More...
 
virtual const index_space_collectionhost () const
 The host collection. More...
 
virtual pod_type index () const
 Index of this space. More...
 
virtual bool is_attached () const
 True if this iterator is attached to a state. More...
 
virtual void attach_to (pod_type xindex)
 Attach to the state with index xindex in the id space family id_spaces(). More...
 
virtual void attach_to (const index_space_collection &xhost, pod_type xlocal_id)
 Attach to the state with local scope id, xlocal_id in the host id space collection xhost. More...
 
virtual void detach ()
 Detach this iterator form its state, if any. More...
 
virtual bool conforms_to_state (const index_space_collection &xhost, pod_type xlocal_id) const
 True if this conforms to the handle type required by the state with local scope id xlocal_id in the host id space collection xhost. More...
 
- Public Member Functions inherited from sheaf::index_space_iterator
virtual ~index_space_iterator ()
 Destructor. More...
 
bool is_done () const
 True if iteration is finished. More...
 
void force_is_done ()
 Makes is_done() true. More...
 
pod_type pod () const
 The current id in the iteration. More...
 
pod_type hub_pod () const
 The current unglued hub id in the iteration. synonym for unglued_hub_pod(). More...
 
pod_type unglued_hub_pod () const
 The current unglued hub id in the iteration. More...
 
pod_type glued_hub_pod () const
 The current glued hub id in the iteration. More...
 
const index_space_familyid_spaces () const
 The id space family for this (const version). More...
 
const hub_index_space_handlehub_id_space () const
 The hub id space. More...
 
std::string name () const
 Name of this space. More...
 
void attach_to (const index_space_family &xid_spaces, pod_type xindex)
 Attach to the state with index xindex in the id space family xid_spaces. More...
 
void attach_to (const index_space_family &xid_spaces, const std::string &xname)
 Attach to the state with name xname in the id space family xid_spaces. More...
 
void attach_to (const std::string &xname)
 Attach to the state with name xname in the id space family id_spaces(). More...
 
void attach_to (const index_space_handle &xid_space)
 Attach to the state of the id space xid_space. More...
 
bool conforms_to_state (const index_space_family &xid_spaces, pod_type xindex) const
 True if this conforms to the handle type required by the state with index xindex in the id space family, xid_spaces. More...
 
bool conforms_to_state (const index_space_family &xid_spaces, const std::string &xname) const
 True if this conforms to the handle type required by the state with name xname in the id space family, xid_spaces. More...
 
bool conforms_to_state (pod_type xid) const
 True if this conforms to the handle type required by the state with id xid. More...
 
bool conforms_to_state (const std::string &xname) const
 True if this conforms to the handle type required by the state with name xname. 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 inherited from sheaf::explicit_index_space_iterator
 explicit_index_space_iterator ()
 Default constructor. More...
 
 explicit_index_space_iterator (const explicit_index_space_iterator &xother)
 Copy constructor. More...
 
explicit_index_space_iteratoroperator= (const explicit_index_space_iterator &xother)
 Assignment operator. More...
 
explicit_index_space_statestate ()
 The explicit state (mutable version). More...
 
const explicit_index_space_statestate () const
 The explicit state (const version). More...
 
explicit_index_space_statestate (pod_type xindex) const
 The explicit id space state at id xindex in id space family id_spaces(). Returns null if no id space stae is available at index xindex. More...
 
explicit_index_space_statestate (const index_space_collection &xhost, pod_type xlocal_id) const
 The explicit id space state with local scope id xlocal_id in the host id space collection xhost. More...
 
- Protected Member Functions inherited from sheaf::index_space_iterator
 index_space_iterator ()
 Creates an iterator for the id space. More...
 
 index_space_iterator (const index_space_iterator &xother)
 Copy constructor. More...
 
void invalidate_ids ()
 Set is_done() and invalidate pod() and hub_pod(). More...
 
- Protected Member Functions inherited from sheaf::any
 any ()
 default constructor More...
 
- Protected Attributes inherited from sheaf::explicit_index_space_iterator
explicit_index_space_state_state
 The explicit state. More...
 
- Protected Attributes inherited from sheaf::index_space_iterator
bool _is_done
 True if the iteration is finished. More...
 
pod_type _pod
 The current id in the iteration. More...
 
pod_type _hub_pod
 The current hub id in the iteration. More...
 

Detailed Description

An iterator over a gathered id space in which the equivlence between the ids in the space and the hub id space is computed using an offset.

Definition at line 39 of file offset_index_space_iterator.h.

Constructor & Destructor Documentation

◆ offset_index_space_iterator() [1/4]

sheaf::offset_index_space_iterator::offset_index_space_iterator ( )

Default constructor.

Postcondition
  • !is_attached()

Definition at line 35 of file offset_index_space_iterator.cc.

References invariant(), and sheaf::explicit_index_space_iterator::is_attached().

Referenced by clone(), and offset_index_space_iterator().

◆ offset_index_space_iterator() [2/4]

sheaf::offset_index_space_iterator::offset_index_space_iterator ( const offset_index_space_iterator xother)

Copy constructor.

Postcondition
  • (*this) == xother

Definition at line 52 of file offset_index_space_iterator.cc.

References invariant(), and offset_index_space_iterator().

◆ offset_index_space_iterator() [3/4]

sheaf::offset_index_space_iterator::offset_index_space_iterator ( const index_space_family xid_spaces,
pod_type  xindex 
)

Constructor: Attach to state with index xindex in the family xid_spaces.

Precondition
  • conforms_to_state(xid_spaces, xindex)
Postcondition

Definition at line 71 of file offset_index_space_iterator.cc.

References attach_to(), conforms_to_state(), sheaf::index_space_iterator::id_spaces(), sheaf::explicit_index_space_iterator::index(), invariant(), sheaf::explicit_index_space_iterator::is_attached(), and offset_index_space_iterator().

◆ offset_index_space_iterator() [4/4]

sheaf::offset_index_space_iterator::offset_index_space_iterator ( const index_space_family xid_spaces,
const std::string &  xname 
)

Constructor: Attach to state with name xname in the family xid_spaces.

Precondition
  • conforms_to_state(xid_spaces, xname)
Postcondition

Definition at line 95 of file offset_index_space_iterator.cc.

References attach_to(), conforms_to_state(), sheaf::index_space_iterator::id_spaces(), invariant(), sheaf::explicit_index_space_iterator::is_attached(), sheaf::index_space_iterator::name(), and operator=().

◆ ~offset_index_space_iterator()

sheaf::offset_index_space_iterator::~offset_index_space_iterator ( )
virtual

Destructor.

Definition at line 149 of file offset_index_space_iterator.cc.

References offset().

Referenced by operator=().

Member Function Documentation

◆ attach_to()

void sheaf::offset_index_space_iterator::attach_to ( explicit_index_space_state xstate)
protectedvirtual

◆ clone()

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

Virtual constructor, makes a new instance of the same type as this. If the iterator is attached, attach to the same state.

Postcondition
  • result != 0
  • is_same_type(result)
  • *result == *this

Implements sheaf::explicit_index_space_iterator.

Definition at line 284 of file offset_index_space_iterator.cc.

References sheaf::any::is_same_type(), next(), and offset_index_space_iterator().

Referenced by operator==().

◆ conforms_to_state()

bool sheaf::offset_index_space_iterator::conforms_to_state ( explicit_index_space_state xstate) const
protectedvirtual

True if this conforms to the iterator type required by the explicit id space state xstate.

Postcondition
  • is_basic_query

Implements sheaf::explicit_index_space_iterator.

Definition at line 435 of file offset_index_space_iterator.cc.

References is_ancestor_of().

Referenced by attach_to(), and offset_index_space_iterator().

◆ ct()

sheaf::size_type sheaf::offset_index_space_iterator::ct ( ) const

The number of entries to iterate over.

Precondition
Postcondition
  • is_basic_query

Definition at line 187 of file offset_index_space_iterator.cc.

References _ct, sheaf::explicit_index_space_iterator::is_attached(), and operator=().

Referenced by offset().

◆ invariant()

◆ is_ancestor_of()

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

Conformance test; true if other conforms to this.

Precondition
  • other != 0

Reimplemented from sheaf::explicit_index_space_iterator.

Definition at line 465 of file offset_index_space_iterator.cc.

References invariant().

Referenced by conforms_to_state(), operator=(), and operator==().

◆ next()

void sheaf::offset_index_space_iterator::next ( )
virtual

◆ offset()

sheaf::offset_index_space_iterator::pod_type sheaf::offset_index_space_iterator::offset ( ) const

The offset into the hub id space.

Precondition
Postcondition
  • is_basic_query

Definition at line 166 of file offset_index_space_iterator.cc.

References _offset, ct(), and sheaf::explicit_index_space_iterator::is_attached().

Referenced by attach_to(), and ~offset_index_space_iterator().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

sheaf::offset_index_space_iterator & sheaf::offset_index_space_iterator::operator= ( const index_space_iterator xother)
virtual

Assignment operator.

Precondition
  • is_ancestor_of(&xother)
Postcondition
  • (*this) == xother

Reimplemented from sheaf::explicit_index_space_iterator.

Definition at line 230 of file offset_index_space_iterator.cc.

References invariant(), is_ancestor_of(), and operator==().

◆ operator==()

bool sheaf::offset_index_space_iterator::operator== ( const index_space_iterator xother) const
virtual

True if this is equivalent to xother.

Precondition
  • is_ancestor_of(&xother)
Postcondition

Reimplemented from sheaf::explicit_index_space_iterator.

Definition at line 255 of file offset_index_space_iterator.cc.

References _ct, _offset, clone(), invariant(), is_ancestor_of(), sheaf::explicit_index_space_iterator::is_attached(), and sheaf::explicit_index_space_iterator::operator==().

Referenced by operator=().

◆ reset()

Member Data Documentation

◆ _ct

size_type sheaf::offset_index_space_iterator::_ct
protected

The number of entries to iterate over.

Definition at line 103 of file offset_index_space_iterator.h.

Referenced by attach_to(), ct(), next(), operator=(), operator==(), and reset().

◆ _offset

pod_type sheaf::offset_index_space_iterator::_offset
protected

The offset into the hub id space.

Definition at line 98 of file offset_index_space_iterator.h.

Referenced by attach_to(), offset(), operator=(), operator==(), and reset().


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