Proto
Public Member Functions
Proto::BoxIterator Class Reference

Iterator for Boxes. More...

#include <Proto_Box.H>

Public Member Functions

 BoxIterator ()
 Constructor.
 
bool operator== (const BoxIterator &a_iter) const
 Equality Operator. More...
 
bool operator!= (const BoxIterator &a_iter) const
 Inequality Operator.
 
Point operator* () const
 Dereference Iterator. More...
 
int operator() () const
 Get Index. More...
 
BoxIteratoroperator++ ()
 Increment Iterator.
 
BoxIteratoroperator-- ()
 Decrement Iterator.
 
bool done ()
 Check if Done.
 

Detailed Description

Iterator for Boxes.

Iteration class which conforms to most of the syntax of std Iterator implementations.

Example:

Box iterBox(Point(1,2,3,4,5,6), Point(2,4,6,8,10,12));
for (auto iter = iterBox.begin(); !iter.done(); ++iter)
{
// Do something for each Point in iterBox
// *iter is a Point instance
// iteration proceeds along lower axes fastest, starting with Bx::low()
// e.g. dimension 0 is fastest, 1 second fastest, etc.
}
//if desired, the user can also iterate backwards:
for (auto iter = iterBox.rbegin(); !iter.done(); --iter)
{
// Do things BACKWARDS
}

Member Function Documentation

◆ operator()()

int Proto::BoxIterator::operator() ( ) const
inline

Get Index.

Returns the current index of the point *(*this).

◆ operator*()

Point Proto::BoxIterator::operator* ( ) const
inline

Dereference Iterator.

Returns a Point

◆ operator==()

bool Proto::BoxIterator::operator== ( const BoxIterator a_iter) const
inline

Equality Operator.

Determines equality between two BoxIterators. Note that this operation CAN return true for BoxIterators constructed from different Box instances so long as said Boxes have the same bounds (e.g. they must be ==)


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