CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
CASM::ScelEnumT< IsConst > Singleton Reference

#include <ScelEnum.hh>

+ Inheritance diagram for CASM::ScelEnumT< IsConst >:

Detailed Description

template<bool IsConst = true>
singleton CASM::ScelEnumT< IsConst >

Enumerate over Supercell.

  • Provides a unified Interface for ScelEnumByName and ScelEnumByProps
  • Enumerated Supercell are canonical, included in PrimClex
  • Template parameter determines if dereferencing iterators returns const or non-const Supercell references
  • If ScelEnumByProps, references are invalidated after incrementing an iterator
  • Typedefs are provided for const-ness switching:

Definition at line 148 of file ScelEnum.hh.

Public Types

typedef InputEnumIterator
< Supercell, IsConst > 
iterator
 
typedef Supercell value_type
 
typedef CASM_TMP::ConstSwitch
< IsConst, Supercell > & 
reference
 
typedef long step_type
 

Public Member Functions

 ScelEnumT (PrimClex &primclex, const jsonParser &input)
 Construct with PrimClex and JSON settings. More...
 
 ScelEnumT (const ScelEnumT &)=delete
 
ScelEnumToperator= (const ScelEnumT &)=delete
 
std::string name () const override
 Derived enumerators must implement name, via ENUM_MEMBERS. More...
 
iterator begin ()
 
iterator end ()
 
reference current () const
 Access the current ObjectType by reference. More...
 
step_type step () const
 Increments with each enumerated object. More...
 
bool valid () const
 Returns false if enumeration is complete. More...
 
virtual jsonParser source (step_type step) const
 

Static Public Member Functions

static int run (PrimClex &primclex, const jsonParser &kwargs, const Completer::EnumOption &enum_opt)
 

Static Public Attributes

static const std::string enumerator_name
 
static const std::string interface_help
 

Protected Member Functions

void _initialize (value_type *_initial)
 
void _initialize ()
 
void _set_current_ptr (value_type *_new)
 Change the pointer. More...
 
value_type_current ()
 Access the current ObjectType by reference. More...
 
void _set_step (step_type val)
 Set current step value. More...
 
void _increment_step ()
 Increment current step value. More...
 
void _decrement_step ()
 Decrement current step value. More...
 
void _invalidate ()
 Call if enumeration complete. More...
 
void _validate ()
 Used if random access enumerator step is moved into valid range. More...
 

Private Member Functions

void increment () override
 Implements increment over all occupations. More...
 

Private Attributes

InputEnumIterator< Supercell,
false > 
m_it
 
InputEnumIterator< Supercell,
false > 
m_end
 
InputEnumerator< Supercell, false > m_enum
 

Related Functions

(Note that these are not member functions.)

typedef ScelEnumT< true > ConstScelEnum
 
typedef ScelEnumT< false > ScelEnum
 

Member Typedef Documentation

typedef InputEnumIterator<Supercell , IsConst> CASM::InputEnumeratorBase< Supercell , IsConst >::iterator
inherited

Definition at line 231 of file InputEnumerator.hh.

typedef CASM_TMP::ConstSwitch<IsConst, Supercell >& CASM::ValEnumerator< Supercell , IsConst >::reference
inherited

Definition at line 192 of file Enumerator.hh.

typedef long CASM::EnumeratorBase::step_type
inherited

Definition at line 103 of file Enumerator.hh.

typedef Supercell CASM::ValEnumerator< Supercell , IsConst >::value_type
inherited

Definition at line 191 of file Enumerator.hh.

Constructor & Destructor Documentation

template<bool IsConst>
CASM::ScelEnumT< IsConst >::ScelEnumT ( PrimClex primclex,
const jsonParser input 
)

Construct with PrimClex and JSON settings.

See also
EnumInterface<ScelEnumT<IsConst> >::run

Definition at line 333 of file ScelEnum_impl.hh.

template<bool IsConst = true>
CASM::ScelEnumT< IsConst >::ScelEnumT ( const ScelEnumT< IsConst > &  )
delete

Member Function Documentation

value_type& CASM::ValEnumerator< Supercell , IsConst >::_current ( )
inlineprotectedinherited

Access the current ObjectType by reference.

Definition at line 244 of file Enumerator.hh.

void CASM::EnumeratorBase::_decrement_step ( )
inlineprotectedinherited

Decrement current step value.

Definition at line 164 of file Enumerator.hh.

void CASM::EnumeratorBase::_increment_step ( )
inlineprotectedinherited

Increment current step value.

Definition at line 159 of file Enumerator.hh.

void CASM::EnumeratorBase::_initialize ( )
inlineprotectedinherited

Initialize

  • Sets step to 0
  • Sets valid to true

Definition at line 148 of file Enumerator.hh.

void CASM::ValEnumerator< Supercell , IsConst >::_initialize ( value_type _initial)
inlineprotectedinherited

Initialize

  • Sets current to point at _initial
  • Sets step to 0
  • Sets valid to true

Definition at line 216 of file Enumerator.hh.

void CASM::EnumeratorBase::_invalidate ( )
inlineprotectedinherited

Call if enumeration complete.

Definition at line 169 of file Enumerator.hh.

void CASM::ValEnumerator< Supercell , IsConst >::_set_current_ptr ( value_type _new)
inlineprotectedinherited

Change the pointer.

Definition at line 239 of file Enumerator.hh.

void CASM::EnumeratorBase::_set_step ( step_type  val)
inlineprotectedinherited

Set current step value.

Definition at line 154 of file Enumerator.hh.

void CASM::EnumeratorBase::_validate ( )
inlineprotectedinherited

Used if random access enumerator step is moved into valid range.

Definition at line 174 of file Enumerator.hh.

iterator CASM::InputEnumeratorBase< Supercell , IsConst >::begin ( )
inlineinherited

Definition at line 245 of file InputEnumerator.hh.

reference CASM::ValEnumerator< Supercell , IsConst >::current ( ) const
inlineinherited

Access the current ObjectType by reference.

Definition at line 232 of file Enumerator.hh.

iterator CASM::InputEnumeratorBase< Supercell , IsConst >::end ( )
inlineinherited

Definition at line 249 of file InputEnumerator.hh.

template<bool IsConst>
void CASM::ScelEnumT< IsConst >::increment ( )
overrideprivatevirtual

Implements increment over all occupations.

Implements CASM::InputEnumeratorBase< Supercell, IsConst >.

Definition at line 357 of file ScelEnum_impl.hh.

template<bool IsConst>
std::string CASM::ScelEnumT< IsConst >::name ( ) const
overridevirtual

Derived enumerators must implement name, via ENUM_MEMBERS.

Implements CASM::EnumeratorBase.

Definition at line 192 of file ScelEnum_impl.hh.

template<bool IsConst = true>
ScelEnumT& CASM::ScelEnumT< IsConst >::operator= ( const ScelEnumT< IsConst > &  )
delete
template<bool IsConst = true>
static int CASM::ScelEnumT< IsConst >::run ( PrimClex primclex,
const jsonParser kwargs,
const Completer::EnumOption enum_opt 
)
static
virtual jsonParser CASM::EnumeratorBase::source ( step_type  step) const
inlinevirtualinherited

Default Object source just uses step#

Returns:

{
"enumerated_by": "<enumerator_type>",
"step": <step #>
}

Definition at line 131 of file Enumerator.hh.

step_type CASM::EnumeratorBase::step ( ) const
inlineinherited

Increments with each enumerated object.

Definition at line 113 of file Enumerator.hh.

bool CASM::EnumeratorBase::valid ( ) const
inlineinherited

Returns false if enumeration is complete.

Definition at line 118 of file Enumerator.hh.

Friends And Related Function Documentation

template<bool IsConst = true>
typedef ScelEnumT<true> ConstScelEnum
related

Definition at line 177 of file ScelEnum.hh.

template<bool IsConst = true>
typedef ScelEnumT<false> ScelEnum
related

Definition at line 180 of file ScelEnum.hh.

Member Data Documentation

template<bool IsConst = true>
const std::string CASM::ScelEnumT< IsConst >::enumerator_name
static

Definition at line 161 of file ScelEnum.hh.

template<bool IsConst = true>
const std::string CASM::ScelEnumT< IsConst >::interface_help
static

Definition at line 162 of file ScelEnum.hh.

template<bool IsConst = true>
InputEnumIterator<Supercell, false> CASM::ScelEnumT< IsConst >::m_end
private

Definition at line 172 of file ScelEnum.hh.

template<bool IsConst = true>
InputEnumerator<Supercell, false> CASM::ScelEnumT< IsConst >::m_enum
private

Definition at line 173 of file ScelEnum.hh.

template<bool IsConst = true>
InputEnumIterator<Supercell, false> CASM::ScelEnumT< IsConst >::m_it
private

Definition at line 171 of file ScelEnum.hh.


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