Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Mantid::Geometry::HKLGenerator::const_iterator Class Reference

The const_iterator class. More...

#include <HKLGenerator.h>

Inheritance diagram for Mantid::Geometry::HKLGenerator::const_iterator:

Public Member Functions

 const_iterator ()
 Default constructor, requirement from boost::iterator_facade. More...
 
 const_iterator (const Kernel::V3D &current)
 Return an iterator with min = max = current. More...
 
 const_iterator (const Kernel::V3D &hklMin, const Kernel::V3D &hklMax)
 Return an iterator that can move from min to max, with current = min. More...
 

Private Member Functions

void advance (difference_type)
 Required for compilation in VS. More...
 
void decrement ()
 
const Kernel::V3Ddereference () const
 Returns a const reference to the currently pointed at HKL. More...
 
bool equal (const const_iterator &other) const
 Returns true if other is at the same position. More...
 
void increment ()
 Increments HKL, l moves fastest, h moves slowest, wrapping around at the max for each index. More...
 

Private Attributes

int m_h
 
Kernel::V3D m_hkl
 
int m_hMax
 
int m_k
 
int m_kMax
 
int m_kMin
 
int m_l
 
int m_lMax
 
int m_lMin
 

Friends

class boost::iterator_core_access
 

Detailed Description

The const_iterator class.

This class uses boost::iterator_facade to provide a const_iterator interface to HKLGenerator. This makes it very easy to use the standard library algorithms. It's a forward iterator, so it's not possible to use operator[] for random access of specific HKLs (this would have to be done on the generated container if that supports it).

While the iterators can be instantiated directly, the intention is to use HKLGenerator::begin() and HKLGenerator::end().

Definition at line 96 of file HKLGenerator.h.

Constructor & Destructor Documentation

◆ const_iterator() [1/3]

Mantid::Geometry::HKLGenerator::const_iterator::const_iterator ( )

Default constructor, requirement from boost::iterator_facade.

Definition at line 62 of file HKLGenerator.cpp.

◆ const_iterator() [2/3]

Mantid::Geometry::HKLGenerator::const_iterator::const_iterator ( const Kernel::V3D current)
explicit

Return an iterator with min = max = current.

Definition at line 66 of file HKLGenerator.cpp.

◆ const_iterator() [3/3]

Mantid::Geometry::HKLGenerator::const_iterator::const_iterator ( const Kernel::V3D hklMin,
const Kernel::V3D hklMax 
)
explicit

Return an iterator that can move from min to max, with current = min.

Definition at line 71 of file HKLGenerator.cpp.

Member Function Documentation

◆ advance()

void Mantid::Geometry::HKLGenerator::const_iterator::advance ( difference_type  )
inlineprivate

Required for compilation in VS.

Forward iterator can not be used that way, so the implementation does nothing.

Definition at line 121 of file HKLGenerator.h.

◆ decrement()

void Mantid::Geometry::HKLGenerator::const_iterator::decrement ( )
inlineprivate

Definition at line 122 of file HKLGenerator.h.

◆ dereference()

const Kernel::V3D & Mantid::Geometry::HKLGenerator::const_iterator::dereference ( ) const
inlineprivate

Returns a const reference to the currently pointed at HKL.

Definition at line 117 of file HKLGenerator.h.

◆ equal()

bool Mantid::Geometry::HKLGenerator::const_iterator::equal ( const const_iterator other) const
inlineprivate

Returns true if other is at the same position.

Definition at line 112 of file HKLGenerator.h.

◆ increment()

void Mantid::Geometry::HKLGenerator::const_iterator::increment ( )
private

Increments HKL, l moves fastest, h moves slowest, wrapping around at the max for each index.

Definition at line 78 of file HKLGenerator.cpp.

Friends And Related Function Documentation

◆ boost::iterator_core_access

friend class boost::iterator_core_access
friend

Definition at line 107 of file HKLGenerator.h.

Member Data Documentation

◆ m_h

int Mantid::Geometry::HKLGenerator::const_iterator::m_h
private

Definition at line 124 of file HKLGenerator.h.

◆ m_hkl

Kernel::V3D Mantid::Geometry::HKLGenerator::const_iterator::m_hkl
private

Definition at line 125 of file HKLGenerator.h.

◆ m_hMax

int Mantid::Geometry::HKLGenerator::const_iterator::m_hMax
private

Definition at line 127 of file HKLGenerator.h.

◆ m_k

int Mantid::Geometry::HKLGenerator::const_iterator::m_k
private

Definition at line 124 of file HKLGenerator.h.

◆ m_kMax

int Mantid::Geometry::HKLGenerator::const_iterator::m_kMax
private

Definition at line 128 of file HKLGenerator.h.

◆ m_kMin

int Mantid::Geometry::HKLGenerator::const_iterator::m_kMin
private

Definition at line 128 of file HKLGenerator.h.

◆ m_l

int Mantid::Geometry::HKLGenerator::const_iterator::m_l
private

Definition at line 124 of file HKLGenerator.h.

◆ m_lMax

int Mantid::Geometry::HKLGenerator::const_iterator::m_lMax
private

Definition at line 129 of file HKLGenerator.h.

◆ m_lMin

int Mantid::Geometry::HKLGenerator::const_iterator::m_lMin
private

Definition at line 129 of file HKLGenerator.h.


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