CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
CASM::ScelEnumByPropsT< IsConst > Class Template Reference

#include <ScelEnum.hh>

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

Detailed Description

template<bool IsConst = true>
class CASM::ScelEnumByPropsT< IsConst >

Enumerate over Supercell.

  • Specify Supercell using ScelEnumProps (min/max volume, dirs, unit_cell)
  • Enumerated Supercell are canonical, included in PrimClex
  • Template parameter determines if dereferencing iterators returns const or non-const Supercell references
  • References are invalidated after incrementing an iterator
  • Typedefs are provided for const-ness switching:

Definition at line 92 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

 ScelEnumByPropsT (PrimClex &primclex, const ScelEnumProps &enum_props, bool existing_only=false)
 Construct with PrimClex and ScelEnumProps settings. More...
 
 ScelEnumByPropsT (PrimClex &primclex, const jsonParser &input)
 Construct with PrimClex and ScelEnumProps JSON settings. More...
 
 ScelEnumByPropsT (const ScelEnumByPropsT &)=delete
 
ScelEnumByPropsToperator= (const ScelEnumByPropsT &)=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 Attributes

static const std::string enumerator_name = "ScelEnumByProps"
 

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

bool _include (const Lattice &lat) const
 Check for existing supercells. More...
 
void increment () override
 Implements increment over supercells. More...
 

Private Attributes

PrimClexm_primclex
 
std::unique_ptr
< SupercellEnumerator< Lattice > > 
m_lattice_enum
 
SupercellEnumerator< Lattice >
::const_iterator 
m_lat_it
 
SupercellEnumerator< Lattice >
::const_iterator 
m_lat_end
 
bool m_existing_only
 

Related Functions

(Note that these are not member functions.)

typedef ScelEnumByPropsT< true > ConstScelEnumByProps
 
typedef ScelEnumByPropsT< false > ScelEnumByProps
 

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::ScelEnumByPropsT< IsConst >::ScelEnumByPropsT ( PrimClex primclex,
const ScelEnumProps enum_props,
bool  existing_only = false 
)

Construct with PrimClex and ScelEnumProps settings.

Parameters
primclexA PrimClex for which to enumerate Supercells
enum_propsSpecifies which Supercells to enumerate
existing_onlySkip Supercells specified by enum_props but not already existing in the Supercell list

Definition at line 106 of file ScelEnum_impl.hh.

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

Construct with PrimClex and ScelEnumProps JSON settings.

Parameters
primclexA PrimClex for which to enumerate Supercells
inputJSON used to make an ScelEnumProps object specifying which Supercells to enumerate, via make_scel_enum_props
  • The JSON input is also checked for the boolean property "existing_only", which if true indicates that Supercell not already included in the supercell list should be skipped

Definition at line 151 of file ScelEnum_impl.hh.

template<bool IsConst = true>
CASM::ScelEnumByPropsT< IsConst >::ScelEnumByPropsT ( const ScelEnumByPropsT< 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.

template<bool IsConst>
bool CASM::ScelEnumByPropsT< IsConst >::_include ( const Lattice lat) const
private

Check for existing supercells.

Definition at line 179 of file ScelEnum_impl.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::ScelEnumByPropsT< IsConst >::increment ( )
overrideprivatevirtual

Implements increment over supercells.

Implements CASM::InputEnumeratorBase< Supercell, IsConst >.

Definition at line 161 of file ScelEnum_impl.hh.

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

Derived enumerators must implement name, via ENUM_MEMBERS.

Implements CASM::EnumeratorBase.

Definition at line 155 of file ScelEnum_impl.hh.

template<bool IsConst = true>
ScelEnumByPropsT& CASM::ScelEnumByPropsT< IsConst >::operator= ( const ScelEnumByPropsT< IsConst > &  )
delete
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 ScelEnumByPropsT<true> ConstScelEnumByProps
related

Definition at line 129 of file ScelEnum.hh.

template<bool IsConst = true>
typedef ScelEnumByPropsT<false> ScelEnumByProps
related

Definition at line 132 of file ScelEnum.hh.

Member Data Documentation

template<bool IsConst = true>
const std::string CASM::ScelEnumByPropsT< IsConst >::enumerator_name = "ScelEnumByProps"
static

Definition at line 108 of file ScelEnum.hh.

template<bool IsConst = true>
bool CASM::ScelEnumByPropsT< IsConst >::m_existing_only
private

Definition at line 125 of file ScelEnum.hh.

template<bool IsConst = true>
SupercellEnumerator<Lattice>::const_iterator CASM::ScelEnumByPropsT< IsConst >::m_lat_end
private

Definition at line 123 of file ScelEnum.hh.

template<bool IsConst = true>
SupercellEnumerator<Lattice>::const_iterator CASM::ScelEnumByPropsT< IsConst >::m_lat_it
private

Definition at line 122 of file ScelEnum.hh.

template<bool IsConst = true>
std::unique_ptr<SupercellEnumerator<Lattice> > CASM::ScelEnumByPropsT< IsConst >::m_lattice_enum
private

Definition at line 121 of file ScelEnum.hh.

template<bool IsConst = true>
PrimClex* CASM::ScelEnumByPropsT< IsConst >::m_primclex
private

Definition at line 119 of file ScelEnum.hh.


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