OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions
IterRange< I > Class Template Reference

#include <iterator.hh>

Public Types

typedef I iterator_type
typedef I::value_type value_type

Public Member Functions

 IterRange ()
 IterRange (I beg, I end)
bool AtEnd () const
IterRange< I > & Next ()
I::value_type & Get ()
IterRange< I > & operator++ ()
I::value_type & operator* ()

Detailed Description

template<typename I>
class ost::mol::IterRange< I >

adaptor to turn iterator into an iterator range

To turn two iterators marking the half-closed range [beg, end) into a iterator range use:

// ent is an instance of entity
IterRange<AtomHandleIter> atom_range(ent.AtomsBegin(), ent.AtomsEnd());
for (; !atom_range.AtEnd(); ++atom_range) {
}

Definition at line 51 of file iterator.hh.


Member Typedef Documentation

typedef I iterator_type

Definition at line 53 of file iterator.hh.

typedef I::value_type value_type

Definition at line 54 of file iterator.hh.


Constructor & Destructor Documentation

IterRange ( )
inline

Definition at line 55 of file iterator.hh.

IterRange ( beg,
end 
)
inline

Definition at line 56 of file iterator.hh.


Member Function Documentation

bool AtEnd ( ) const
inline

evaluates to true when end of range is reached

Definition at line 60 of file iterator.hh.

I::value_type& Get ( )
inline

Definition at line 68 of file iterator.hh.

IterRange<I>& Next ( )
inline

step to next element in range

Definition at line 64 of file iterator.hh.

I::value_type& operator* ( )
inline

Definition at line 75 of file iterator.hh.

IterRange<I>& operator++ ( )
inline

Definition at line 71 of file iterator.hh.


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