SheafSystem  0.0.0.0
sheaf::interval_set_iterator Class Reference

An iterator over the integers in an interval_set. More...

#include <interval_set_iterator.h>

Inheritance diagram for sheaf::interval_set_iterator:
sheaf::any

INTERVAL_SET_ITERATOR FACET

typedef interval_set::pod_type pod_type
 The "plain old data" index type for this. More...
 
typedef interval_set::map_type map_type
 Type of the interval map. More...
 
typedef interval_set::map_iterator_type map_iterator_type
 Type of the interval map iterator. More...
 
const interval_set_set
 The interval_set this is iterating over. More...
 
bool _is_member_iterator
 True, if iterating over the members of the set. More...
 
pod_type _item
 The current integer in the iteration. More...
 
pod_type _ub
 The upper bound of the current interval. More...
 
const map_type_map
 The interval map. More...
 
map_iterator_type _map_itr
 The interval map iterator. More...
 
 interval_set_iterator (const interval_set &xset, bool xis_member_iterator)
 Creates an iterator for xset. If xis_member_iterator, iterate over the members of the interval. Otherwise, iteration over the non-members within the range if the set. More...
 
 interval_set_iterator (const interval_set_iterator &xother)
 Copy constructor. More...
 
 ~interval_set_iterator ()
 Destructor. More...
 
const interval_setset () const
 The interval set this is iterating over. More...
 
bool is_member_iterator () const
 True, if iterating over members. More...
 
pod_type item () const
 The current integer of the iteration. More...
 
void next ()
 Makes item() the next integer in the iteration. More...
 
bool is_done () const
 True if iteration is finished. More...
 
void reset ()
 Restarts the iteration. More...
 
 interval_set_iterator ()
 Default constructor; disabled. More...
 
void next_interval ()
 Assign the item to the beginning of the next interval. More...
 
bool is_member_interval () const
 True, if the current interval is an interval of members. More...
 

ANY FACET

virtual bool is_ancestor_of (const any *other) const
 Conformance test; true if other conforms to this. More...
 
virtual interval_set_iteratorclone () const
 Virtual constructor, makes a new instance of the same type as this. More...
 
interval_set_iteratoroperator= (const interval_set_iterator &xother)
 Assignment operator. More...
 
virtual bool operator== (const interval_set_iterator &xother) const
 True if this is equivalent to xother. 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 iterator over the integers in an interval_set.

Definition at line 42 of file interval_set_iterator.h.

Member Typedef Documentation

◆ map_iterator_type

Type of the interval map iterator.

Definition at line 154 of file interval_set_iterator.h.

◆ map_type

Type of the interval map.

Definition at line 144 of file interval_set_iterator.h.

◆ pod_type

The "plain old data" index type for this.

Definition at line 55 of file interval_set_iterator.h.

Constructor & Destructor Documentation

◆ interval_set_iterator() [1/3]

sheaf::interval_set_iterator::interval_set_iterator ( const interval_set xset,
bool  xis_member_iterator 
)

Creates an iterator for xset. If xis_member_iterator, iterate over the members of the interval. Otherwise, iteration over the non-members within the range if the set.

Postcondition

Definition at line 31 of file interval_set_iterator.cc.

References _is_member_iterator, _map, _set, invariant(), reset(), and ~interval_set_iterator().

◆ interval_set_iterator() [2/3]

sheaf::interval_set_iterator::interval_set_iterator ( const interval_set_iterator xother)

Copy constructor.

Postcondition

Definition at line 186 of file interval_set_iterator.cc.

References invariant(), and next_interval().

◆ ~interval_set_iterator()

sheaf::interval_set_iterator::~interval_set_iterator ( )

Destructor.

Definition at line 53 of file interval_set_iterator.cc.

References set().

Referenced by interval_set_iterator().

◆ interval_set_iterator() [3/3]

sheaf::interval_set_iterator::interval_set_iterator ( )
inlineprotected

Default constructor; disabled.

Definition at line 109 of file interval_set_iterator.h.

Referenced by clone(), and reset().

Member Function Documentation

◆ clone()

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

Virtual constructor, makes a new instance of the same type as this.

Postcondition
  • result != 0
  • is_same_type(result)

Reimplemented from sheaf::any.

Definition at line 274 of file interval_set_iterator.cc.

References _is_member_iterator, _set, interval_set_iterator(), is_member_iterator(), sheaf::any::is_same_type(), operator=(), and set().

Referenced by is_ancestor_of().

◆ invariant()

◆ is_ancestor_of()

bool sheaf::interval_set_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 253 of file interval_set_iterator.cc.

References clone().

Referenced by is_member_interval().

◆ is_done()

bool sheaf::interval_set_iterator::is_done ( ) const

◆ is_member_interval()

bool sheaf::interval_set_iterator::is_member_interval ( ) const
protected

True, if the current interval is an interval of members.

Definition at line 237 of file interval_set_iterator.cc.

References _map_itr, and is_ancestor_of().

Referenced by invariant(), and next_interval().

◆ is_member_iterator()

bool sheaf::interval_set_iterator::is_member_iterator ( ) const

True, if iterating over members.

Definition at line 77 of file interval_set_iterator.cc.

References _is_member_iterator, and item().

Referenced by clone(), invariant(), next_interval(), and set().

◆ item()

sheaf::interval_set_iterator::pod_type sheaf::interval_set_iterator::item ( ) const

The current integer of the iteration.

Precondition
  • !is_done()

Definition at line 84 of file interval_set_iterator.cc.

References _item, is_done(), and next().

Referenced by is_member_iterator(), sheaf::hub_index_space_iterator::next(), sheaf::operator<<(), and sheaf::hub_index_space_iterator::reset().

◆ next()

void sheaf::interval_set_iterator::next ( )

Makes item() the next integer in the iteration.

Precondition
  • !is_done()
Postcondition

Definition at line 101 of file interval_set_iterator.cc.

References _item, _map, _map_itr, _ub, sheaf::invalid_pod_index(), invariant(), is_done(), and next_interval().

Referenced by item(), sheaf::hub_index_space_iterator::next(), and sheaf::operator<<().

◆ next_interval()

void sheaf::interval_set_iterator::next_interval ( )
protected

Assign the item to the beginning of the next interval.

Precondition
  • !is_done()
Postcondition

Definition at line 205 of file interval_set_iterator.cc.

References _item, _map, _map_itr, _ub, sheaf::invalid_pod_index(), is_done(), is_member_interval(), and is_member_iterator().

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

◆ operator=()

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

Assignment operator.

Postcondition

Definition at line 298 of file interval_set_iterator.cc.

References _is_member_iterator, _item, _map, _map_itr, _set, _ub, invariant(), and operator==().

Referenced by clone().

◆ operator==()

bool sheaf::interval_set_iterator::operator== ( const interval_set_iterator xother) const
virtual

True if this is equivalent to xother.

Definition at line 322 of file interval_set_iterator.cc.

References _is_member_iterator, _item, _map, _map_itr, _set, _ub, and invariant().

Referenced by operator=().

◆ reset()

void sheaf::interval_set_iterator::reset ( )

◆ set()

const sheaf::interval_set & sheaf::interval_set_iterator::set ( ) const

The interval set this is iterating over.

Definition at line 70 of file interval_set_iterator.cc.

References _set, and is_member_iterator().

Referenced by clone(), and ~interval_set_iterator().

Member Data Documentation

◆ _is_member_iterator

bool sheaf::interval_set_iterator::_is_member_iterator
protected

True, if iterating over the members of the set.

Definition at line 129 of file interval_set_iterator.h.

Referenced by clone(), interval_set_iterator(), is_member_iterator(), operator=(), operator==(), and reset().

◆ _item

pod_type sheaf::interval_set_iterator::_item
protected

The current integer in the iteration.

Definition at line 134 of file interval_set_iterator.h.

Referenced by item(), next(), next_interval(), operator=(), and operator==().

◆ _map

const map_type* sheaf::interval_set_iterator::_map
protected

The interval map.

Definition at line 149 of file interval_set_iterator.h.

Referenced by interval_set_iterator(), is_done(), next(), next_interval(), operator=(), operator==(), and reset().

◆ _map_itr

map_iterator_type sheaf::interval_set_iterator::_map_itr
protected

The interval map iterator.

Definition at line 159 of file interval_set_iterator.h.

Referenced by is_done(), is_member_interval(), next(), next_interval(), operator=(), operator==(), and reset().

◆ _set

const interval_set* sheaf::interval_set_iterator::_set
protected

The interval_set this is iterating over.

Definition at line 124 of file interval_set_iterator.h.

Referenced by clone(), interval_set_iterator(), operator=(), operator==(), and set().

◆ _ub

pod_type sheaf::interval_set_iterator::_ub
protected

The upper bound of the current interval.

Definition at line 139 of file interval_set_iterator.h.

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


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