CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::InputEnumIteratorBase< ValueType, IsConst > Class Template Reference

#include <InputEnumerator.hh>

+ Inheritance diagram for CASM::InputEnumIteratorBase< ValueType, IsConst >:

Detailed Description

template<typename ValueType, bool IsConst = true>
class CASM::InputEnumIteratorBase< ValueType, IsConst >

Definition at line 17 of file InputEnumerator.hh.

Public Types

typedef ValueType value_type
 
typedef ValEnumerator< ValueType, IsConst >::reference reference
 
typedef EnumeratorBase::step_type step_type
 

Public Member Functions

 InputEnumIteratorBase ()
 
 InputEnumIteratorBase (InputEnumeratorBase< ValueType, IsConst > &enumerator, bool is_end)
 
virtual step_type step () const override
 
virtual bool is_end () const override
 
std::unique_ptr< InputEnumIteratorBaseclone () const
 
std::string name () const
 Uses enumerator class 'name' implementation. More...
 
jsonParser source () const
 
virtual bool is_end () const =0
 Returns true if 'end' iterator. More...
 
std::string name () const
 Uses enumerator class 'name' implementation. More...
 
jsonParser source () const
 
virtual step_type step () const =0
 

Protected Member Functions

bool _constructed_as_end () const
 
void _assert_ptr () const
 
void _assert_ptr () const
 
void _assert_same_ptr (const EnumIteratorBase &other) const
 
void _assert_same_ptr (const EnumIteratorBase &other) const
 
void _assert_valid () const
 
void _assert_valid () const
 
EnumeratorBase_enum_ptr ()
 
EnumeratorBase_enum_ptr () const
 
EnumeratorBase_enum_ptr () const
 
bool equal (const EnumIteratorBase &other) const
 boost::iterator_facade implementation More...
 
bool equal (const EnumIteratorBase &other) const
 boost::iterator_facade implementation More...
 

Private Member Functions

virtual InputEnumIteratorBase< ValueType, IsConst > * _clone () const override
 
virtual reference dereference () const override
 boost::iterator_facade implementation More...
 
virtual void increment ()
 boost::iterator_facade implementation More...
 
InputEnumeratorBase< ValueType, IsConst > & _enum ()
 static_cast enumerator pointer to InputEnumeratorBase& More...
 
InputEnumeratorBase< ValueType, IsConst > & _enum () const
 static_cast enumerator pointer to InputEnumeratorBase& More...
 

Private Attributes

friend InputEnumIterator< ValueType, IsConst >
 
bool m_constructed_as_end
 
EnumeratorBasem_enum_ptr
 

Member Typedef Documentation

◆ reference

typedef ValEnumerator<ValueType, IsConst>::reference CASM::ValEnumIterator< ValueType, IsConst >::reference
inherited

Definition at line 310 of file Enumerator.hh.

◆ step_type

Definition at line 308 of file Enumerator.hh.

◆ value_type

typedef ValueType CASM::ValEnumIterator< ValueType, IsConst >::value_type
inherited

Definition at line 309 of file Enumerator.hh.

Constructor & Destructor Documentation

◆ InputEnumIteratorBase() [1/2]

template<typename ValueType , bool IsConst = true>
CASM::InputEnumIteratorBase< ValueType, IsConst >::InputEnumIteratorBase ( )
inline

Definition at line 25 of file InputEnumerator.hh.

◆ InputEnumIteratorBase() [2/2]

template<typename ValueType , bool IsConst = true>
CASM::InputEnumIteratorBase< ValueType, IsConst >::InputEnumIteratorBase ( InputEnumeratorBase< ValueType, IsConst > &  enumerator,
bool  is_end 
)
inline

Definition at line 27 of file InputEnumerator.hh.

Member Function Documentation

◆ _assert_ptr() [1/2]

void CASM::EnumIteratorBase::_assert_ptr ( ) const
inlineprotectedinherited

Definition at line 262 of file Enumerator.hh.

◆ _assert_ptr() [2/2]

void CASM::EnumIteratorBase::_assert_ptr
inlineprotectedinherited

Definition at line 329 of file Enumerator.hh.

◆ _assert_same_ptr() [1/2]

void CASM::EnumIteratorBase::_assert_same_ptr ( const EnumIteratorBase other) const
inlineprotectedinherited

Definition at line 256 of file Enumerator.hh.

◆ _assert_same_ptr() [2/2]

void CASM::EnumIteratorBase::_assert_same_ptr
inlineprotectedinherited

Definition at line 330 of file Enumerator.hh.

◆ _assert_valid() [1/2]

void CASM::EnumIteratorBase::_assert_valid ( ) const
inlineprotectedinherited

Definition at line 266 of file Enumerator.hh.

◆ _assert_valid() [2/2]

void CASM::EnumIteratorBase::_assert_valid
inlineprotectedinherited

Definition at line 331 of file Enumerator.hh.

◆ _clone()

template<typename ValueType , bool IsConst = true>
virtual InputEnumIteratorBase<ValueType, IsConst>* CASM::InputEnumIteratorBase< ValueType, IsConst >::_clone ( ) const
inlineoverrideprivatevirtual

◆ _constructed_as_end()

template<typename ValueType , bool IsConst = true>
bool CASM::InputEnumIteratorBase< ValueType, IsConst >::_constructed_as_end ( ) const
inlineprotected

Definition at line 63 of file InputEnumerator.hh.

◆ _enum() [1/2]

template<typename ValueType , bool IsConst = true>
InputEnumeratorBase<ValueType, IsConst>& CASM::InputEnumIteratorBase< ValueType, IsConst >::_enum ( )
inlineprivate

static_cast enumerator pointer to InputEnumeratorBase&

Definition at line 77 of file InputEnumerator.hh.

◆ _enum() [2/2]

template<typename ValueType , bool IsConst = true>
InputEnumeratorBase<ValueType, IsConst>& CASM::InputEnumIteratorBase< ValueType, IsConst >::_enum ( ) const
inlineprivate

static_cast enumerator pointer to InputEnumeratorBase&

Definition at line 82 of file InputEnumerator.hh.

◆ _enum_ptr() [1/3]

EnumeratorBase* CASM::EnumIteratorBase::_enum_ptr
inlineprotectedinherited

Definition at line 332 of file Enumerator.hh.

◆ _enum_ptr() [2/3]

EnumeratorBase* CASM::EnumIteratorBase::_enum_ptr ( ) const
inlineprotectedinherited

Definition at line 292 of file Enumerator.hh.

◆ _enum_ptr() [3/3]

EnumeratorBase* CASM::EnumIteratorBase::_enum_ptr
inlineprotectedinherited

Definition at line 332 of file Enumerator.hh.

◆ clone()

template<typename ValueType , bool IsConst = true>
std::unique_ptr<InputEnumIteratorBase> CASM::InputEnumIteratorBase< ValueType, IsConst >::clone ( ) const
inline

Definition at line 56 of file InputEnumerator.hh.

◆ dereference()

template<typename ValueType , bool IsConst = true>
virtual reference CASM::InputEnumIteratorBase< ValueType, IsConst >::dereference ( ) const
inlineoverrideprivatevirtual

boost::iterator_facade implementation

Implements CASM::ValEnumIterator< ValueType, true >.

Reimplemented in CASM::RandomAccessEnumIteratorBase< ValueType, IsConst >.

Definition at line 71 of file InputEnumerator.hh.

◆ equal() [1/2]

bool CASM::EnumIteratorBase::equal ( const EnumIteratorBase other) const
inlineprotectedinherited

boost::iterator_facade implementation

  • Uses 'is_end' implementation to check if both iterators are 'end'
  • If both are not end, then compares iterator 'step'

Definition at line 275 of file Enumerator.hh.

◆ equal() [2/2]

bool CASM::EnumIteratorBase::equal
inlineprotectedinherited

boost::iterator_facade implementation

  • Uses 'is_end' implementation to check if both iterators are 'end'
  • If both are not end, then compares iterator 'step'

Definition at line 333 of file Enumerator.hh.

◆ increment()

template<typename ValueType , bool IsConst = true>
virtual void CASM::InputEnumIteratorBase< ValueType, IsConst >::increment ( )
inlineprivatevirtual

boost::iterator_facade implementation

Reimplemented in CASM::RandomAccessEnumIteratorBase< ValueType, IsConst >.

Definition at line 74 of file InputEnumerator.hh.

◆ is_end() [1/2]

virtual bool CASM::EnumIteratorBase::is_end
inherited

Returns true if 'end' iterator.

◆ is_end() [2/2]

template<typename ValueType , bool IsConst = true>
virtual bool CASM::InputEnumIteratorBase< ValueType, IsConst >::is_end ( ) const
inlineoverridevirtual

Check if end iterator

Returns true if:

  • Iterator was constructed as end iterator
  • Or, !InputEnumeratorBase->valid()
    • This means that the derived InputEnumerator class implementation must call _invalidate in the increment implementation if the end has been reached

Implements CASM::EnumIteratorBase.

Reimplemented in CASM::RandomAccessEnumIteratorBase< ValueType, IsConst >.

Definition at line 51 of file InputEnumerator.hh.

◆ name() [1/2]

std::string CASM::EnumIteratorBase::name ( ) const
inlineinherited

Uses enumerator class 'name' implementation.

Definition at line 246 of file Enumerator.hh.

◆ name() [2/2]

template<typename ValueType , bool IsConst = true>
std::string CASM::EnumIteratorBase::name
inline

Uses enumerator class 'name' implementation.

Definition at line 246 of file Enumerator.hh.

◆ source() [1/2]

jsonParser CASM::EnumIteratorBase::source ( ) const
inlineinherited

Uses 'step' and enumerator class 'source' implementation

  • Only valid if iterator refers to valid object (not end)

Definition at line 243 of file Enumerator.hh.

◆ source() [2/2]

template<typename ValueType , bool IsConst = true>
jsonParser CASM::EnumIteratorBase::source
inline

Uses 'step' and enumerator class 'source' implementation

  • Only valid if iterator refers to valid object (not end)

Definition at line 243 of file Enumerator.hh.

◆ step() [1/2]

virtual step_type CASM::EnumIteratorBase::step
inherited

Return current step number

  • Only valid if iterator refers to valid object (not end)

◆ step() [2/2]

template<typename ValueType , bool IsConst = true>
virtual step_type CASM::InputEnumIteratorBase< ValueType, IsConst >::step ( ) const
inlineoverridevirtual

Return current step number

  • Only valid if iterator refers to valid object (not end)

Implements CASM::EnumIteratorBase.

Reimplemented in CASM::RandomAccessEnumIteratorBase< ValueType, IsConst >.

Definition at line 38 of file InputEnumerator.hh.

Member Data Documentation

◆ InputEnumIterator< ValueType, IsConst >

template<typename ValueType , bool IsConst = true>
friend CASM::InputEnumIteratorBase< ValueType, IsConst >::InputEnumIterator< ValueType, IsConst >
private

Definition at line 18 of file InputEnumerator.hh.

◆ m_constructed_as_end

template<typename ValueType , bool IsConst = true>
bool CASM::InputEnumIteratorBase< ValueType, IsConst >::m_constructed_as_end
private

Definition at line 86 of file InputEnumerator.hh.

◆ m_enum_ptr

EnumeratorBase* CASM::EnumIteratorBase::m_enum_ptr
privateinherited

Definition at line 302 of file Enumerator.hh.


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