SheafSystem  0.0.0.0
sheaf::index_space_family_iterator Class Reference

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

#include <index_space_family_iterator.h>

Inheritance diagram for sheaf::index_space_family_iterator:
sheaf::any

INDEX_SPACE_FAMILY_ITERATOR FACET

typedef pod_index_type pod_type
 The "plain old data" index type for this. More...
 
typedef index_space_family::interval_map_type interval_map_type
 Type of interval map. More...
 
typedef interval_map_type::const_iterator const_interval_iterator_type
 Type of interval map iterator. More...
 
const index_space_family_id_spaces
 The index space family. More...
 
const_interval_iterator_type _interval_itr
 The stl iterator over the intervals. More...
 
index_space_interval_iterator _id_space_itr
 The iterator over id spaces for the current id space interval. More...
 
 index_space_family_iterator (const index_space_family &xid_spaces, bool xonly_persistent)
 Constructor: Creates an instance with id_spaces() == xid_spaces and only_persistent() == xonly_persistent. More...
 
virtual ~index_space_family_iterator ()
 Destructor. More...
 
index_space_family_iteratoroperator= (const index_space_family_iterator &xother)
 Assignment operator. More...
 
bool operator== (const index_space_family_iterator &xother) const
 True if this is equivalent to xother. More...
 
index_space_family_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...
 
bool only_persistent () const
 True if only the persistent id spaces are iterated over. 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...
 
const index_space_intervalhost () const
 The current host id space interval being iterated over. More...
 
pod_type index () const
 The index of the current id space in the iteration. More...
 
std::string name () const
 The name of the current id space in the iteration. More...
 
 index_space_family_iterator ()
 Default constructor; disabled. More...
 
 index_space_family_iterator (const index_space_family_iterator &xother)
 Copy constructor. More...
 
void next_id_space ()
 Increment to the next id space in the interval. More...
 

INDEX SPACE FACET

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...
 
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 50 of file index_space_family_iterator.h.

Member Typedef Documentation

◆ const_interval_iterator_type

typedef interval_map_type::const_iterator sheaf::index_space_family_iterator::const_interval_iterator_type
protected

Type of interval map iterator.

Definition at line 153 of file index_space_family_iterator.h.

◆ interval_map_type

◆ pod_type

The "plain old data" index type for this.

Definition at line 63 of file index_space_family_iterator.h.

Constructor & Destructor Documentation

◆ index_space_family_iterator() [1/3]

sheaf::index_space_family_iterator::index_space_family_iterator ( const index_space_family xid_spaces,
bool  xonly_persistent 
)

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

Postcondition

Definition at line 34 of file index_space_family_iterator.cc.

References id_spaces(), invariant(), only_persistent(), reset(), and ~index_space_family_iterator().

◆ ~index_space_family_iterator()

sheaf::index_space_family_iterator::~index_space_family_iterator ( )
virtual

Destructor.

Definition at line 57 of file index_space_family_iterator.cc.

References operator=().

Referenced by index_space_family_iterator().

◆ index_space_family_iterator() [2/3]

sheaf::index_space_family_iterator::index_space_family_iterator ( )
inlineprotected

Default constructor; disabled.

Definition at line 133 of file index_space_family_iterator.h.

Referenced by clone(), and name().

◆ index_space_family_iterator() [3/3]

sheaf::index_space_family_iterator::index_space_family_iterator ( const index_space_family_iterator xother)
protected

Copy constructor.

Postcondition
  • (*this) == xother

Definition at line 357 of file index_space_family_iterator.cc.

References invariant(), and next_id_space().

Member Function Documentation

◆ allocated_id_space()

bool sheaf::index_space_family_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 787 of file index_space_family_iterator.cc.

References _id_space_itr, sheaf::index_space_interval_iterator::allocated_id_space(), get_id_space_iterator(), and is_done().

Referenced by release_id_space().

◆ allocated_id_space_iterator()

bool sheaf::index_space_family_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 862 of file index_space_family_iterator.cc.

References _id_space_itr, sheaf::index_space_interval_iterator::allocated_id_space_iterator(), is_ancestor_of(), and is_done().

Referenced by release_id_space_iterator().

◆ begin()

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

Beginning id of this space.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 481 of file index_space_family_iterator.cc.

References _id_space_itr, sheaf::index_space_interval_iterator::begin(), end(), and is_done().

Referenced by ct().

◆ clone()

sheaf::index_space_family_iterator * sheaf::index_space_family_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 121 of file index_space_family_iterator.cc.

References index_space_family_iterator(), sheaf::any::is_same_type(), and only_persistent().

Referenced by operator==().

◆ contains() [1/2]

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

True if this space contains id xid.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 523 of file index_space_family_iterator.cc.

References _id_space_itr, sheaf::index_space_interval_iterator::contains(), contains_hub(), and is_done().

Referenced by contains_glued_hub(), end(), and pod().

◆ contains() [2/2]

bool sheaf::index_space_family_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 607 of file index_space_family_iterator.cc.

References _id_space_itr, sheaf::index_space_interval_iterator::contains(), is_done(), and pod().

◆ contains_glued_hub()

bool sheaf::index_space_family_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 586 of file index_space_family_iterator.cc.

References _id_space_itr, contains(), sheaf::index_space_interval_iterator::contains_glued_hub(), and is_done().

Referenced by contains_unglued_hub(), and glued_hub_pod().

◆ contains_hub()

bool sheaf::index_space_family_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 544 of file index_space_family_iterator.cc.

References _id_space_itr, sheaf::index_space_interval_iterator::contains_hub(), contains_unglued_hub(), and is_done().

Referenced by contains(), and hub_pod().

◆ contains_unglued_hub()

bool sheaf::index_space_family_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 565 of file index_space_family_iterator.cc.

References _id_space_itr, contains_glued_hub(), sheaf::index_space_interval_iterator::contains_unglued_hub(), and is_done().

Referenced by contains_hub(), and unglued_hub_pod().

◆ ct()

sheaf::size_type sheaf::index_space_family_iterator::ct ( ) const

The number of members.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 460 of file index_space_family_iterator.cc.

References _id_space_itr, begin(), sheaf::index_space_interval_iterator::ct(), and is_done().

Referenced by hub_id_space().

◆ end()

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

Ending id of this space.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 502 of file index_space_family_iterator.cc.

References _id_space_itr, contains(), sheaf::index_space_interval_iterator::end(), and is_done().

Referenced by begin().

◆ get_id_space()

sheaf::index_space_handle & sheaf::index_space_family_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 744 of file index_space_family_iterator.cc.

References _id_space_itr, sheaf::index_space_interval_iterator::get_id_space(), sheaf::index_space_handle::is_attached(), is_done(), and release_id_space().

Referenced by is_persistent().

◆ get_id_space_iterator()

sheaf::index_space_iterator & sheaf::index_space_family_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 819 of file index_space_family_iterator.cc.

References _id_space_itr, sheaf::index_space_interval_iterator::get_id_space_iterator(), sheaf::index_space_iterator::is_attached(), is_done(), and release_id_space_iterator().

Referenced by allocated_id_space(), and sheaf::index_equivalence_class::index_equivalence_class().

◆ glued_hub_pod()

sheaf::index_space_handle::pod_type sheaf::index_space_family_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 691 of file index_space_family_iterator.cc.

References _id_space_itr, contains_glued_hub(), sheaf::index_space_interval_iterator::glued_hub_pod(), is_done(), is_persistent(), and sheaf::is_valid().

Referenced by unglued_hub_pod().

◆ host()

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

The current host id space interval being iterated over.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 293 of file index_space_family_iterator.cc.

References _id_space_itr, sheaf::index_space_interval_iterator::host(), index(), and is_done().

Referenced by reset().

◆ hub_id_space()

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

The hub id space.

Postcondition
  • is_basic_query

Definition at line 441 of file index_space_family_iterator.cc.

References _id_spaces, ct(), and sheaf::index_space_family::hub_id_space().

Referenced by id_spaces().

◆ hub_pod()

sheaf::index_space_handle::pod_type sheaf::index_space_family_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 649 of file index_space_family_iterator.cc.

References _id_space_itr, contains_hub(), sheaf::index_space_interval_iterator::hub_pod(), is_done(), sheaf::is_valid(), and unglued_hub_pod().

Referenced by pod().

◆ id_spaces()

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

The id space family for this (const version).

Postcondition
  • is_basic_query

Definition at line 422 of file index_space_family_iterator.cc.

References _id_spaces, and hub_id_space().

Referenced by index_space_family_iterator(), and next_id_space().

◆ index()

sheaf::index_space_family_iterator::pod_type sheaf::index_space_family_iterator::index ( ) const

The index of the current id space in the iteration.

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

Definition at line 314 of file index_space_family_iterator.cc.

References _id_space_itr, sheaf::index_space_interval_iterator::index(), is_done(), sheaf::is_valid(), and name().

Referenced by host(), sheaf::index_equivalence_class::index_equivalence_class(), invariant(), name(), next(), and sheaf::operator<<().

◆ invariant()

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

◆ is_ancestor_of()

bool sheaf::index_space_family_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 894 of file index_space_family_iterator.cc.

References invariant().

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

◆ is_done()

◆ is_persistent()

bool sheaf::index_space_family_iterator::is_persistent ( ) const

True if this id space should be written to disk.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 712 of file index_space_family_iterator.cc.

References _id_space_itr, get_id_space(), is_done(), and sheaf::index_space_interval_iterator::is_persistent().

Referenced by glued_hub_pod(), and next_id_space().

◆ name()

std::string sheaf::index_space_family_iterator::name ( ) const

The name of the current id space in the iteration.

Precondition
  • !is_done()
Postcondition
  • is_basic_query

Definition at line 335 of file index_space_family_iterator.cc.

References _id_spaces, index(), index_space_family_iterator(), is_done(), and sheaf::index_space_family::name().

Referenced by index(), and sheaf::operator<<().

◆ next()

◆ next_id_space()

void sheaf::index_space_family_iterator::next_id_space ( )
protected

Increment to the next id space in the interval.

Precondition
  • _id_space_itr.is_attached()
Postcondition

Definition at line 377 of file index_space_family_iterator.cc.

References _id_space_itr, id_spaces(), sheaf::index_space_interval_iterator::is_attached(), sheaf::index_space_interval_iterator::is_done(), is_persistent(), sheaf::index_space_interval_iterator::next(), and only_persistent().

Referenced by index_space_family_iterator(), next(), and reset().

◆ only_persistent()

bool sheaf::index_space_family_iterator::only_persistent ( ) const

True if only the persistent id spaces are iterated over.

Postcondition
  • is_basic_query

Definition at line 143 of file index_space_family_iterator.cc.

References _id_space_itr, next(), and sheaf::index_space_interval_iterator::only_persistent().

Referenced by clone(), sheaf::index_equivalence_class::index_equivalence_class(), index_space_family_iterator(), next(), next_id_space(), and reset().

◆ operator=()

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

Assignment operator.

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

Definition at line 74 of file index_space_family_iterator.cc.

References _id_space_itr, _id_spaces, _interval_itr, invariant(), is_ancestor_of(), and operator==().

Referenced by ~index_space_family_iterator().

◆ operator==()

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

True if this is equivalent to xother.

Precondition
  • is_ancestor_of(&xother)
Postcondition
  • is_basic_query

Definition at line 98 of file index_space_family_iterator.cc.

References _id_space_itr, _id_spaces, _interval_itr, clone(), and is_ancestor_of().

Referenced by operator=().

◆ pod()

sheaf::index_space_handle::pod_type sheaf::index_space_family_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 628 of file index_space_family_iterator.cc.

References _id_space_itr, contains(), hub_pod(), is_done(), sheaf::is_valid(), and sheaf::index_space_interval_iterator::pod().

Referenced by contains().

◆ release_id_space()

void sheaf::index_space_family_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 765 of file index_space_family_iterator.cc.

References _id_space_itr, allocated_id_space(), is_done(), and sheaf::index_space_interval_iterator::release_id_space().

Referenced by get_id_space().

◆ release_id_space_iterator()

void sheaf::index_space_family_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 840 of file index_space_family_iterator.cc.

References _id_space_itr, allocated_id_space_iterator(), is_done(), and sheaf::index_space_interval_iterator::release_id_space_iterator().

Referenced by get_id_space_iterator(), and sheaf::index_equivalence_class::index_equivalence_class().

◆ reset()

◆ unglued_hub_pod()

sheaf::index_space_handle::pod_type sheaf::index_space_family_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 670 of file index_space_family_iterator.cc.

References _id_space_itr, contains_unglued_hub(), glued_hub_pod(), is_done(), sheaf::is_valid(), and sheaf::index_space_interval_iterator::unglued_hub_pod().

Referenced by hub_pod().

Member Data Documentation

◆ _id_space_itr

◆ _id_spaces

const index_space_family* sheaf::index_space_family_iterator::_id_spaces
protected

The index space family.

Definition at line 158 of file index_space_family_iterator.h.

Referenced by hub_id_space(), id_spaces(), name(), next(), operator=(), operator==(), and reset().

◆ _interval_itr

const_interval_iterator_type sheaf::index_space_family_iterator::_interval_itr
protected

The stl iterator over the intervals.

Definition at line 163 of file index_space_family_iterator.h.

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


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