Fréchet View  1.6.0
A Tool for Exploring Fréchet Distance Algorithms
frechet::data::BitSet::iterator Class Reference

Detailed Description

an iterator over a BitSet

Iterates over the set (true) bits of a BitSet.

Note that iterators allow for modifications to the underlying BitSet (contrary to some standard iterators).

Definition at line 93 of file bitset.h.

#include <bitset.h>

Public Member Functions

 iterator ()
 empty constructor; creates an invalid iterator More...
 
 iterator (const iterator &that)
 copy constructor More...
 
iteratoroperator= (const iterator &that)
 assignment operator More...
 
bool operator== (const iterator &that) const
 equality comparator More...
 
bool valid () const
 
int operator * () const
 
iteratoroperator++ ()
 pre-increment; move to the next set (true) bit More...
 
iterator operator++ (int)
 post-increment; move to the next set (true) bit More...
 
iteratoroperator-- ()
 pre-decrement; move to the previous set (true) bit More...
 
iterator operator-- (int)
 post-decrement; move to the previous set (true) bit More...
 
iteratoroperator+= (int n)
 skip operator More...
 
iterator operator+ (int n) const
 skip operator More...
 
iteratoroperator-= (int n)
 skip operator More...
 
iterator operator- (int n)
 skip operator More...
 
int operator- (const iterator &that)
 difference operator More...
 

Private Member Functions

 iterator (const BitSet *aparent, int start)
 constructor with parent and offset More...
 

Private Attributes

const BitSetparent
 parent BitSet More...
 
int _offset
 current offset More...
 

Friends

class BitSet
 

Constructor & Destructor Documentation

◆ iterator() [1/3]

BitSet::iterator::iterator ( )

empty constructor; creates an invalid iterator

Definition at line 196 of file bitset.cpp.

◆ iterator() [2/3]

BitSet::iterator::iterator ( const iterator that)

copy constructor

Parameters
thatiterator to copy from

Definition at line 198 of file bitset.cpp.

◆ iterator() [3/3]

BitSet::iterator::iterator ( const BitSet aparent,
int  start 
)
private

constructor with parent and offset

Parameters
aparentparent BitSet
startinitial offset

Definition at line 275 of file bitset.cpp.

Member Function Documentation

◆ operator *()

int BitSet::iterator::operator * ( ) const
Returns
current offset of iterator

Definition at line 216 of file bitset.cpp.

◆ operator+()

BitSet::iterator BitSet::iterator::operator+ ( int  n) const

skip operator

Parameters
nnumber of set bits to skip
Returns
copy of this iterator after incrementing

Definition at line 249 of file bitset.cpp.

◆ operator++() [1/2]

BitSet::iterator & BitSet::iterator::operator++ ( )

pre-increment; move to the next set (true) bit

Returns
this iterator, after incrementing

Definition at line 221 of file bitset.cpp.

◆ operator++() [2/2]

BitSet::iterator BitSet::iterator::operator++ ( int  )

post-increment; move to the next set (true) bit

Returns
copy of this iterator, before incrementing

Definition at line 226 of file bitset.cpp.

◆ operator+=()

BitSet::iterator & BitSet::iterator::operator+= ( int  n)

skip operator

Parameters
nnumber of set bits to skip
Returns
this iterator after incrementing

Definition at line 243 of file bitset.cpp.

◆ operator-() [1/2]

BitSet::iterator BitSet::iterator::operator- ( int  n)

skip operator

Parameters
nnumber of set bits to skip
Returns
copy of this iterator after decrementing

Definition at line 261 of file bitset.cpp.

◆ operator-() [2/2]

int BitSet::iterator::operator- ( const iterator that)

difference operator

Parameters
thatiterator to compare with
Returns
difference between this and 'that' iterator

Definition at line 267 of file bitset.cpp.

◆ operator--() [1/2]

BitSet::iterator & BitSet::iterator::operator-- ( )

pre-decrement; move to the previous set (true) bit

Returns
this iterator, after decrementing

Definition at line 232 of file bitset.cpp.

◆ operator--() [2/2]

BitSet::iterator BitSet::iterator::operator-- ( int  )

post-decrement; move to the previous set (true) bit

Returns
copy of this iterator, before decrementing

Definition at line 237 of file bitset.cpp.

◆ operator-=()

BitSet::iterator & BitSet::iterator::operator-= ( int  n)

skip operator

Parameters
nnumber of set bits to skip
Returns
this iterator after decrementing

Definition at line 255 of file bitset.cpp.

◆ operator=()

BitSet::iterator & BitSet::iterator::operator= ( const iterator that)

assignment operator

Parameters
thatiterator to copy from
Returns
this iterator, after assigning a copy

Definition at line 200 of file bitset.cpp.

◆ operator==()

bool BitSet::iterator::operator== ( const iterator that) const

equality comparator

Parameters
thatiterator to compare with
Returns
true if both iterators point to the same offset; and refer to the same BitSet

Definition at line 206 of file bitset.cpp.

◆ valid()

bool BitSet::iterator::valid ( ) const
Returns
true if the iterator points to a valid offet

Definition at line 211 of file bitset.cpp.

Friends And Related Function Documentation

◆ BitSet

friend class BitSet
friend

Definition at line 154 of file bitset.h.

Member Data Documentation

◆ _offset

int frechet::data::BitSet::iterator::_offset
private

current offset

Definition at line 158 of file bitset.h.

◆ parent

const BitSet* frechet::data::BitSet::iterator::parent
private

parent BitSet

Definition at line 156 of file bitset.h.


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