SheafSystem  0.0.0.0
sheaf::index_space_interval_iterator Class Reference

An abstract iterator over the id spaces of a interval. More...

#include <index_space_interval_iterator.h>

Inheritance diagram for sheaf::index_space_interval_iterator:
sheaf::any

Friends

class index_space_family
 
class index_space_family_iterator
 

INDEX_SPACE_INTERVAL_ITERATOR FACET

typedef pod_index_type pod_type
 The "plain old data" index type for this. More...
 
index_space_interval_host
 The host id space interval being iterated over. More...
 
bool _only_persistent
 True if only the persistent id spaces are iterated over. More...
 
pod_type _local_id
 The local id of the current id space in the iteration. More...
 
size_type _ub
 The upper bound of the iteration. More...
 
virtual ~index_space_interval_iterator ()
 Destructor. More...
 
index_space_interval_iteratoroperator= (const index_space_interval_iterator &xother)
 Assignment operator. More...
 
bool operator== (const index_space_interval_iterator &xother) const
 True if this is equivalent to xother. More...
 
index_space_interval_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...
 
const index_space_intervalhost () const
 The host id space interval being iterated over. More...
 
bool only_persistent () const
 True if only the persistent id spaces are iterated over. More...
 
size_type ub () const
 The upper bound of the id spaces. More...
 
void next ()
 Makes id_space() the next id space in the iteration. More...
 
bool is_done () const
 True if iteration is finished. More...
 
void reset ()
 Restarts the iteration. More...
 
pod_type index () const
 The index of the current id space in the iteration. More...
 
 index_space_interval_iterator ()
 Default constructor; disabled. More...
 
 index_space_interval_iterator (const index_space_interval_iterator &xother)
 Copy constructor. More...
 
 index_space_interval_iterator (bool xonly_persistent)
 Constructor: Creates an instance with only_persistent() == xonly_persistent. More...
 
void attach_to (index_space_interval &xhost)
 Attach this iterator to the host xhost. More...
 
void detach ()
 Detach this iterator. More...
 
bool is_attached () const
 True, if this iterator is attached. More...
 

INDEX SPACE FACET

const index_space_familyid_spaces () const
 The id space family for this (const version). More...
 
index_space_familyid_spaces ()
 The id space family for this (mutable version). More...
 
const hub_index_space_handlehub_id_space () const
 The hub id space. More...
 
size_type ct () const
 The number of members. More...
 
pod_type begin () const
 Beginning id of this space. More...
 
pod_type end () const
 Ending id of this space. More...
 
bool contains (pod_type xid) const
 True if this space contains id xid. More...
 
bool contains_hub (pod_type xid) const
 True if this space contains an id equivalent to xid in the unglued hub id space. More...
 
bool contains_unglued_hub (pod_type xid) const
 True if this space contains an id equivalent to xid in the unglued hub id space. More...
 
bool contains_glued_hub (pod_type xid) const
 True if this space contains an id equivalent to xid in the glued hub id space. More...
 
bool contains (pod_type xid, pod_type xhub_id) const
 True if this space contains an id xid equivalent to xhub_id in the hub id space. More...
 
pod_type pod (pod_type xid) const
 The pod index in this space equivalent to xid in the hub id space. More...
 
pod_type hub_pod (pod_type xid) const
 The pod index in the unglued hub id space equivalent to xid in this id space. More...
 
pod_type unglued_hub_pod (pod_type xid) const
 The pod index in the unglued hub id space equivalent to xid in this id space. More...
 
pod_type glued_hub_pod (pod_type xid) const
 The pod index in the glued hub id space equivalent to xid in this id space. More...
 
bool is_persistent () const
 True if this id space should be written to disk. More...
 

HANDLE POOL FACET

index_space_handleget_id_space () const
 Allocates an id space handle from the handle pool attached to the current id space state. More...
 
void release_id_space (index_space_handle &xid_space) const
 Returns the id space handle xid_space to the handle pool. More...
 
bool allocated_id_space (index_space_handle &xid_space) const
 True if and only if id space handle xid_space was allocated by the handle pool. More...
 

ITERATOR POOL FACET

index_space_iteratorget_id_space_iterator () const
 Allocates an id space iterator from the iterator pool attached to the current id space state. More...
 
void release_id_space_iterator (index_space_iterator &xitr) const
 Returns the id space iterator xitr to the iterator pool. More...
 
bool allocated_id_space_iterator (index_space_iterator &xitr) const
 True if and only if id space iterator xitr was allocated by the iterator pool. 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 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::any
 any ()
 default constructor More...
 

Detailed Description

An abstract iterator over the id spaces of a interval.

Definition at line 48 of file index_space_interval_iterator.h.

Member Typedef Documentation

◆ pod_type

The "plain old data" index type for this.

Definition at line 64 of file index_space_interval_iterator.h.

Constructor & Destructor Documentation

◆ ~index_space_interval_iterator()

sheaf::index_space_interval_iterator::~index_space_interval_iterator ( )
virtual

Destructor.

Definition at line 35 of file index_space_interval_iterator.cc.

References operator=().

◆ index_space_interval_iterator() [1/3]

sheaf::index_space_interval_iterator::index_space_interval_iterator ( )
inlineprotected

Default constructor; disabled.

Definition at line 127 of file index_space_interval_iterator.h.

Referenced by clone(), index(), and index_space_interval_iterator().

◆ index_space_interval_iterator() [2/3]

sheaf::index_space_interval_iterator::index_space_interval_iterator ( const index_space_interval_iterator xother)
protected

Copy constructor.

Postcondition
  • (*this) == xother

Definition at line 298 of file index_space_interval_iterator.cc.

References index_space_interval_iterator(), and invariant().

◆ index_space_interval_iterator() [3/3]

sheaf::index_space_interval_iterator::index_space_interval_iterator ( bool  xonly_persistent)
protected

Constructor: Creates an instance with only_persistent() == xonly_persistent.

Postcondition
  • !is_attached()

Definition at line 317 of file index_space_interval_iterator.cc.

References attach_to(), invariant(), is_attached(), and only_persistent().

Member Function Documentation

◆ allocated_id_space()

bool sheaf::index_space_interval_iterator::allocated_id_space ( index_space_handle xid_space) const

True if and only if id space handle xid_space was allocated by the handle pool.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 817 of file index_space_interval_iterator.cc.

References _host, sheaf::index_space_collection::allocated_id_space(), get_id_space_iterator(), is_attached(), and is_done().

Referenced by sheaf::index_space_family_iterator::allocated_id_space(), and release_id_space().

◆ allocated_id_space_iterator()

bool sheaf::index_space_interval_iterator::allocated_id_space_iterator ( index_space_iterator xitr) const

True if and only if id space iterator xitr was allocated by the iterator pool.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 895 of file index_space_interval_iterator.cc.

References _host, sheaf::index_space_collection::allocated_id_space_iterator(), is_ancestor_of(), is_attached(), and is_done().

Referenced by sheaf::index_space_family_iterator::allocated_id_space_iterator(), and release_id_space_iterator().

◆ attach_to()

void sheaf::index_space_interval_iterator::attach_to ( index_space_interval xhost)
protected

◆ begin()

sheaf::index_space_handle::pod_type sheaf::index_space_interval_iterator::begin ( ) const

Beginning id of this space.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 497 of file index_space_interval_iterator.cc.

References _host, _local_id, sheaf::index_space_interval::begin(), end(), is_attached(), and is_done().

Referenced by sheaf::index_space_family_iterator::begin(), and ct().

◆ clone()

sheaf::index_space_interval_iterator * sheaf::index_space_interval_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

Reimplemented from sheaf::any.

Definition at line 101 of file index_space_interval_iterator.cc.

References host(), index_space_interval_iterator(), and sheaf::any::is_same_type().

Referenced by operator==().

◆ contains() [1/2]

bool sheaf::index_space_interval_iterator::contains ( pod_type  xid) const

True if this space contains id xid.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 541 of file index_space_interval_iterator.cc.

References _host, _local_id, sheaf::index_space_interval::contains(), contains_hub(), is_attached(), and is_done().

Referenced by sheaf::index_space_family_iterator::contains(), contains_glued_hub(), end(), and pod().

◆ contains() [2/2]

bool sheaf::index_space_interval_iterator::contains ( pod_type  xid,
pod_type  xhub_id 
) const

True if this space contains an id xid equivalent to xhub_id in the hub id space.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 629 of file index_space_interval_iterator.cc.

References _host, _local_id, sheaf::index_space_interval::contains(), is_attached(), is_done(), and pod().

◆ contains_glued_hub()

bool sheaf::index_space_interval_iterator::contains_glued_hub ( pod_type  xid) const

True if this space contains an id equivalent to xid in the glued hub id space.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 607 of file index_space_interval_iterator.cc.

References _host, _local_id, contains(), sheaf::index_space_collection::contains_glued_hub(), is_attached(), and is_done().

Referenced by sheaf::index_space_family_iterator::contains_glued_hub(), contains_unglued_hub(), and glued_hub_pod().

◆ contains_hub()

bool sheaf::index_space_interval_iterator::contains_hub ( pod_type  xid) const

True if this space contains an id equivalent to xid in the unglued hub id space.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 563 of file index_space_interval_iterator.cc.

References _host, _local_id, sheaf::index_space_collection::contains_hub(), contains_unglued_hub(), is_attached(), and is_done().

Referenced by contains(), sheaf::index_space_family_iterator::contains_hub(), and hub_pod().

◆ contains_unglued_hub()

bool sheaf::index_space_interval_iterator::contains_unglued_hub ( pod_type  xid) const

True if this space contains an id equivalent to xid in the unglued hub id space.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 585 of file index_space_interval_iterator.cc.

References _host, _local_id, contains_glued_hub(), sheaf::index_space_collection::contains_unglued_hub(), is_attached(), and is_done().

Referenced by contains_hub(), sheaf::index_space_family_iterator::contains_unglued_hub(), and unglued_hub_pod().

◆ ct()

sheaf::size_type sheaf::index_space_interval_iterator::ct ( ) const

The number of members.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 475 of file index_space_interval_iterator.cc.

References _host, _local_id, begin(), sheaf::index_space_collection::ct(), is_attached(), and is_done().

Referenced by sheaf::index_space_family_iterator::ct(), and hub_id_space().

◆ detach()

void sheaf::index_space_interval_iterator::detach ( )
protected

Detach this iterator.

Postcondition
  • !is_attached()

Definition at line 364 of file index_space_interval_iterator.cc.

References _host, invariant(), and is_attached().

Referenced by attach_to(), sheaf::index_space_family_iterator::next(), and sheaf::index_space_family_iterator::reset().

◆ end()

sheaf::index_space_handle::pod_type sheaf::index_space_interval_iterator::end ( ) const

Ending id of this space.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 519 of file index_space_interval_iterator.cc.

References _host, _local_id, contains(), sheaf::index_space_interval::end(), is_attached(), and is_done().

Referenced by begin(), and sheaf::index_space_family_iterator::end().

◆ get_id_space()

sheaf::index_space_handle & sheaf::index_space_interval_iterator::get_id_space ( ) const

Allocates an id space handle from the handle pool attached to the current id space state.

Precondition
  • !is_done()
Postcondition
  • result.is_attached()

Definition at line 772 of file index_space_interval_iterator.cc.

References _host, _local_id, sheaf::index_space_collection::get_id_space(), is_attached(), sheaf::index_space_handle::is_attached(), is_done(), and release_id_space().

Referenced by sheaf::index_space_family_iterator::get_id_space(), and is_persistent().

◆ get_id_space_iterator()

sheaf::index_space_iterator & sheaf::index_space_interval_iterator::get_id_space_iterator ( ) const

Allocates an id space iterator from the iterator pool attached to the current id space state.

Precondition
  • !is_done()
Postcondition
  • result.is_attached()

Definition at line 850 of file index_space_interval_iterator.cc.

References _host, _local_id, sheaf::index_space_collection::get_id_space_iterator(), is_attached(), sheaf::index_space_iterator::is_attached(), is_done(), and release_id_space_iterator().

Referenced by allocated_id_space(), and sheaf::index_space_family_iterator::get_id_space_iterator().

◆ glued_hub_pod()

sheaf::index_space_handle::pod_type sheaf::index_space_interval_iterator::glued_hub_pod ( pod_type  xid) const

The pod index in the glued hub id space equivalent to xid in this id space.

Precondition
  • !is_done()
Postcondition
  • !is_valid(result) || contains_glued_hub(result)

Definition at line 717 of file index_space_interval_iterator.cc.

References _host, _local_id, contains_glued_hub(), sheaf::index_space_collection::glued_hub_pod(), is_attached(), is_done(), is_persistent(), and sheaf::is_valid().

Referenced by sheaf::index_space_family_iterator::glued_hub_pod(), and unglued_hub_pod().

◆ host()

const sheaf::index_space_interval & sheaf::index_space_interval_iterator::host ( ) const

The host id space interval being iterated over.

Precondition
Postcondition
  • is_basic_query

Definition at line 123 of file index_space_interval_iterator.cc.

References _host, is_attached(), and only_persistent().

Referenced by attach_to(), clone(), and sheaf::index_space_family_iterator::host().

◆ hub_id_space()

const sheaf::hub_index_space_handle & sheaf::index_space_interval_iterator::hub_id_space ( ) const

The hub id space.

Precondition
Postcondition
  • is_basic_query

Definition at line 454 of file index_space_interval_iterator.cc.

References ct(), sheaf::index_space_family::hub_id_space(), id_spaces(), and is_attached().

Referenced by id_spaces().

◆ hub_pod()

sheaf::index_space_handle::pod_type sheaf::index_space_interval_iterator::hub_pod ( pod_type  xid) const

The pod index in the unglued hub id space equivalent to xid in this id space.

Precondition
  • !is_done()
Postcondition
  • !is_valid(result) || contains_hub(result)

Definition at line 673 of file index_space_interval_iterator.cc.

References _host, _local_id, contains_hub(), sheaf::index_space_collection::hub_pod(), is_attached(), is_done(), sheaf::is_valid(), and unglued_hub_pod().

Referenced by sheaf::index_space_family_iterator::hub_pod(), and pod().

◆ id_spaces() [1/2]

const sheaf::index_space_family & sheaf::index_space_interval_iterator::id_spaces ( ) const

The id space family for this (const version).

Precondition
Postcondition
  • is_basic_query

Definition at line 412 of file index_space_interval_iterator.cc.

References _host, sheaf::index_space_interval::id_spaces(), and is_attached().

Referenced by hub_id_space(), and is_attached().

◆ id_spaces() [2/2]

sheaf::index_space_family & sheaf::index_space_interval_iterator::id_spaces ( )

The id space family for this (mutable version).

Precondition
Postcondition
  • is_basic_query

Definition at line 433 of file index_space_interval_iterator.cc.

References _host, hub_id_space(), sheaf::index_space_interval::id_spaces(), and is_attached().

◆ index()

sheaf::index_space_interval_iterator::pod_type sheaf::index_space_interval_iterator::index ( ) const

The index of the current id space in the iteration.

Precondition
  • !is_done()
Postcondition
  • is_valid(result)

Definition at line 275 of file index_space_interval_iterator.cc.

References _host, _local_id, sheaf::index_space_interval::family_scope(), index_space_interval_iterator(), is_attached(), is_done(), and sheaf::is_valid().

Referenced by sheaf::index_space_family_iterator::index(), invariant(), next(), and reset().

◆ invariant()

bool sheaf::index_space_interval_iterator::invariant ( ) const
virtual

◆ is_ancestor_of()

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

Conformance test; true if other conforms to this.

Precondition
  • other != 0

Reimplemented from sheaf::any.

Definition at line 928 of file index_space_interval_iterator.cc.

References invariant().

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

◆ is_attached()

◆ is_done()

◆ is_persistent()

bool sheaf::index_space_interval_iterator::is_persistent ( ) const

True if this id space should be written to disk.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 739 of file index_space_interval_iterator.cc.

References _host, _local_id, get_id_space(), is_attached(), is_done(), and sheaf::index_space_collection::is_persistent().

Referenced by glued_hub_pod(), and sheaf::index_space_family_iterator::is_persistent().

◆ next()

void sheaf::index_space_interval_iterator::next ( )

◆ only_persistent()

bool sheaf::index_space_interval_iterator::only_persistent ( ) const

True if only the persistent id spaces are iterated over.

Postcondition
  • is_basic_query

Definition at line 144 of file index_space_interval_iterator.cc.

References _only_persistent, and ub().

Referenced by host(), index_space_interval_iterator(), and sheaf::index_space_family_iterator::only_persistent().

◆ operator=()

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

Assignment operator.

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

Definition at line 52 of file index_space_interval_iterator.cc.

References _host, _local_id, _only_persistent, _ub, invariant(), is_ancestor_of(), and operator==().

Referenced by ~index_space_interval_iterator().

◆ operator==()

bool sheaf::index_space_interval_iterator::operator== ( const index_space_interval_iterator xother) const

True if this is equivalent to xother.

Precondition
  • is_ancestor_of(&xother)
Postcondition
  • is_basic_query

Definition at line 77 of file index_space_interval_iterator.cc.

References _host, _local_id, _only_persistent, _ub, clone(), and is_ancestor_of().

Referenced by operator=().

◆ pod()

sheaf::index_space_handle::pod_type sheaf::index_space_interval_iterator::pod ( pod_type  xid) const

The pod index in this space equivalent to xid in the hub id space.

Precondition
  • !is_done()
Postcondition
  • !is_valid(result) || contains(result)

Definition at line 651 of file index_space_interval_iterator.cc.

References _host, _local_id, contains(), hub_pod(), is_attached(), is_done(), sheaf::is_valid(), and sheaf::index_space_collection::pod().

Referenced by contains(), and sheaf::index_space_family_iterator::pod().

◆ release_id_space()

void sheaf::index_space_interval_iterator::release_id_space ( index_space_handle xid_space) const

Returns the id space handle xid_space to the handle pool.

Precondition
  • !is_done()
  • allocated_id_space(xid_space)
Postcondition
  • is_basic_query

Definition at line 794 of file index_space_interval_iterator.cc.

References _host, allocated_id_space(), is_attached(), is_done(), and sheaf::index_space_collection::release_id_space().

Referenced by get_id_space(), and sheaf::index_space_family_iterator::release_id_space().

◆ release_id_space_iterator()

void sheaf::index_space_interval_iterator::release_id_space_iterator ( index_space_iterator xitr) const

Returns the id space iterator xitr to the iterator pool.

Precondition
  • !is_done()
  • allocated_id_space_iterator(xitr)
Postcondition
  • is_basic_query

Definition at line 872 of file index_space_interval_iterator.cc.

References _host, allocated_id_space_iterator(), is_attached(), is_done(), and sheaf::index_space_collection::release_id_space_iterator().

Referenced by get_id_space_iterator(), and sheaf::index_space_family_iterator::release_id_space_iterator().

◆ reset()

void sheaf::index_space_interval_iterator::reset ( )

Restarts the iteration.

Precondition
Postcondition

Definition at line 242 of file index_space_interval_iterator.cc.

References _host, _local_id, _ub, sheaf::index_space_interval::contains(), index(), sheaf::invalid_pod_index(), invariant(), and is_attached().

Referenced by attach_to(), and is_done().

◆ ub()

sheaf::size_type sheaf::index_space_interval_iterator::ub ( ) const

The upper bound of the id spaces.

Precondition
Postcondition
  • is_basic_query

Definition at line 163 of file index_space_interval_iterator.cc.

References _ub, is_attached(), and next().

Referenced by attach_to(), and only_persistent().

◆ unglued_hub_pod()

sheaf::index_space_handle::pod_type sheaf::index_space_interval_iterator::unglued_hub_pod ( pod_type  xid) const

The pod index in the unglued hub id space equivalent to xid in this id space.

Precondition
  • !is_done()
Postcondition
  • !is_valid(result) || contains_unglued_hub(result)

Definition at line 695 of file index_space_interval_iterator.cc.

References _host, _local_id, contains_unglued_hub(), glued_hub_pod(), is_attached(), is_done(), sheaf::is_valid(), and sheaf::index_space_collection::unglued_hub_pod().

Referenced by hub_pod(), and sheaf::index_space_family_iterator::unglued_hub_pod().

Member Data Documentation

◆ _host

◆ _local_id

pod_type sheaf::index_space_interval_iterator::_local_id
protected

◆ _only_persistent

bool sheaf::index_space_interval_iterator::_only_persistent
protected

True if only the persistent id spaces are iterated over.

Definition at line 162 of file index_space_interval_iterator.h.

Referenced by next(), only_persistent(), operator=(), and operator==().

◆ _ub

size_type sheaf::index_space_interval_iterator::_ub
protected

The upper bound of the iteration.

Definition at line 172 of file index_space_interval_iterator.h.

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


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