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

#include <ScelEnum.hh>

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

Detailed Description

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

Enumerate over Supercell.

Definition at line 36 of file ScelEnum.hh.

Public Types

typedef
RandomAccessEnumIterator
< Supercell, IsConst > 
iterator
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 
typedef step_type size_type
 
typedef Supercell value_type
 
typedef CASM_TMP::ConstSwitch
< IsConst, Supercell > & 
reference
 
typedef long step_type
 

Public Member Functions

 ScelEnumByNameT (PrimClex &primclex, std::initializer_list< std::string > scelnames)
 Construct with PrimClex and ScelEnumProps settings. More...
 
template<typename ScelNameIterator >
 ScelEnumByNameT (PrimClex &primclex, ScelNameIterator begin, ScelNameIterator end)
 Construct with PrimClex and ScelEnumProps settings. More...
 
 ScelEnumByNameT (PrimClex &primclex, const jsonParser &input)
 Construct with PrimClex and array of supercell names. More...
 
std::string name () const override
 Derived enumerators must implement name, via ENUM_MEMBERS. More...
 
iterator begin ()
 
iterator end ()
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
size_type size () const
 Number of elements in enumerator. More...
 
reference front ()
 Reference to first element in enumerator. More...
 
reference back ()
 Reference to last element in enumerator. More...
 
reference initial ()
 Reference to first element in enumerator. More...
 
reference final ()
 Reference to last element in enumerator. More...
 
reference operator[] (size_type n)
 Reference an element in enumerator. More...
 
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 = "ScelEnumByName"
 

Protected Member Functions

void _set_size (size_type val)
 Set size value. More...
 
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

Supercellat_step (step_type n) override
 Implements at_step. More...
 
void _init ()
 

Private Attributes

PrimClexm_primclex
 
std::vector< Supercell * > m_scelptr
 

Related Functions

(Note that these are not member functions.)

typedef ScelEnumByNameT< true > ConstScelEnumByName
 
typedef ScelEnumByNameT< false > ScelEnumByName
 

Member Typedef Documentation

Definition at line 287 of file RandomAccessEnumerator.hh.

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

Definition at line 192 of file Enumerator.hh.

typedef std::reverse_iterator<iterator> CASM::RandomAccessEnumeratorBase< Supercell , IsConst >::reverse_iterator
inherited

Definition at line 288 of file RandomAccessEnumerator.hh.

Definition at line 289 of file RandomAccessEnumerator.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::ScelEnumByNameT< IsConst >::ScelEnumByNameT ( PrimClex primclex,
std::initializer_list< std::string >  scelnames 
)

Construct with PrimClex and ScelEnumProps settings.

Construct with PrimClex a initializer_list of Supercell names.

Parameters
primclexA PrimClex for which to enumerate Supercells
scelnamesA list of names of Supercells to enumerate

Definition at line 19 of file ScelEnum_impl.hh.

template<bool IsConst>
template<typename ScelNameIterator >
CASM::ScelEnumByNameT< IsConst >::ScelEnumByNameT ( PrimClex primclex,
ScelNameIterator  begin,
ScelNameIterator  end 
)

Construct with PrimClex and ScelEnumProps settings.

Construct with PrimClex and a range of Supercell names.

Parameters
primclexA PrimClex for which to enumerate Supercells
begin,endA range of names of Supercells to enumerate

Definition at line 39 of file ScelEnum_impl.hh.

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

Construct with PrimClex and array of supercell names.

Construct with PrimClex and JSON array containing supercell names.

Parameters
primclexA PrimClex for which to enumerate Supercells
inputA JSON array of names of Supercells to enumerate

Definition at line 58 of file ScelEnum_impl.hh.

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.

template<bool IsConst>
void CASM::ScelEnumByNameT< IsConst >::_init ( )
private

Definition at line 83 of file ScelEnum_impl.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::RandomAccessEnumeratorBase< Supercell , IsConst >::_set_size ( size_type  val)
inlineprotectedinherited

Set size value.

Definition at line 365 of file RandomAccessEnumerator.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.

template<bool IsConst>
Supercell * CASM::ScelEnumByNameT< IsConst >::at_step ( step_type  n)
overrideprivatevirtual

Implements at_step.

Random access implementation.

Implements CASM::RandomAccessEnumeratorBase< Supercell, IsConst >.

Definition at line 78 of file ScelEnum_impl.hh.

reference CASM::RandomAccessEnumeratorBase< Supercell , IsConst >::back ( )
inlineinherited

Reference to last element in enumerator.

Definition at line 333 of file RandomAccessEnumerator.hh.

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

Definition at line 305 of file RandomAccessEnumerator.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::RandomAccessEnumeratorBase< Supercell , IsConst >::end ( )
inlineinherited

Definition at line 309 of file RandomAccessEnumerator.hh.

reference CASM::RandomAccessEnumeratorBase< Supercell , IsConst >::final ( )
inlineinherited

Reference to last element in enumerator.

Definition at line 344 of file RandomAccessEnumerator.hh.

reference CASM::RandomAccessEnumeratorBase< Supercell , IsConst >::front ( )
inlineinherited

Reference to first element in enumerator.

Definition at line 327 of file RandomAccessEnumerator.hh.

reference CASM::RandomAccessEnumeratorBase< Supercell , IsConst >::initial ( )
inlineinherited

Reference to first element in enumerator.

Definition at line 339 of file RandomAccessEnumerator.hh.

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

Derived enumerators must implement name, via ENUM_MEMBERS.

Implements CASM::EnumeratorBase.

Definition at line 72 of file ScelEnum_impl.hh.

reference CASM::RandomAccessEnumeratorBase< Supercell , IsConst >::operator[] ( size_type  n)
inlineinherited

Reference an element in enumerator.

Definition at line 349 of file RandomAccessEnumerator.hh.

reverse_iterator CASM::RandomAccessEnumeratorBase< Supercell , IsConst >::rbegin ( )
inlineinherited

Definition at line 313 of file RandomAccessEnumerator.hh.

reverse_iterator CASM::RandomAccessEnumeratorBase< Supercell , IsConst >::rend ( )
inlineinherited

Definition at line 317 of file RandomAccessEnumerator.hh.

size_type CASM::RandomAccessEnumeratorBase< Supercell , IsConst >::size ( ) const
inlineinherited

Number of elements in enumerator.

Definition at line 322 of file RandomAccessEnumerator.hh.

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 ScelEnumByNameT<true> ConstScelEnumByName
related

Definition at line 74 of file ScelEnum.hh.

template<bool IsConst = true>
typedef ScelEnumByNameT<false> ScelEnumByName
related

Definition at line 77 of file ScelEnum.hh.

Member Data Documentation

template<bool IsConst = true>
const std::string CASM::ScelEnumByNameT< IsConst >::enumerator_name = "ScelEnumByName"
static

Definition at line 56 of file ScelEnum.hh.

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

Definition at line 68 of file ScelEnum.hh.

template<bool IsConst = true>
std::vector<Supercell *> CASM::ScelEnumByNameT< IsConst >::m_scelptr
private

Definition at line 70 of file ScelEnum.hh.


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