CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <RandomAccessEnumerator.hh>
Base class for implementing specialized random access enumerators.
InputEnumerator allow random access iteration over some objects of ValueType. The specialized class should document any guaranteed properties of the enumerated objects. For instance, some enumerators may guarantee that objects will be unique, others may not. Some may guarantee objects will be primitive or in canonical form, others may not. Etc.
Derived classes (ex. MyDerivedEnumClass) must implement:
Derived classes should contain ENUMERATOR_MEMBERS(MyDerivedClass) in the class definition to automatically implement:
In CASM namespace near the derived class definition, include:
Definition at line 251 of file RandomAccessEnumerator.hh.
Public Types | |
typedef RandomAccessEnumIterator< ValueType, IsConst > | iterator |
typedef std::reverse_iterator< iterator > | reverse_iterator |
typedef step_type | size_type |
typedef ValueType | value_type |
typedef CASM_TMP::ConstSwitch< IsConst, ValueType > & | reference |
typedef long | step_type |
Public Member Functions | |
RandomAccessEnumeratorBase (size_type size=0) | |
virtual | ~RandomAccessEnumeratorBase () |
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... | |
virtual std::string | name () const=0 |
Derived enumerators must implement name, via ENUM_MEMBERS. More... | |
virtual std::string | name () const =0 |
Derived enumerators must implement name, via ENUM_MEMBERS. More... | |
virtual jsonParser | source (step_type step) const |
virtual jsonParser | source (step_type step) const |
step_type | step () const |
Increments with each enumerated object. More... | |
step_type | step () const |
Increments with each enumerated object. More... | |
bool | valid () const |
Returns false if enumeration is complete. More... | |
bool | valid () const |
Returns false if enumeration is complete. More... | |
Protected Member Functions | |
void | _set_size (size_type val) |
Set size value. More... | |
void | _initialize (CASM_TMP::ConstSwitch< IsConst, value_type > *_initial) |
void | _initialize () |
void | _set_current_ptr (CASM_TMP::ConstSwitch< IsConst, value_type > *_new) |
Change the pointer. More... | |
void | _decrement_step () |
Decrement current step value. More... | |
void | _increment_step () |
Increment current step value. More... | |
void | _invalidate () |
Call if enumeration complete. More... | |
void | _set_step (step_type val) |
Set current step value. More... | |
void | _set_step (step_type val) |
Set current step value. More... | |
void | _validate () |
Used if random access enumerator step is moved into valid range. More... | |
Private Member Functions | |
virtual CASM_TMP::ConstSwitch< IsConst, value_type > * | at_step (step_type n)=0 |
void | goto_step (step_type n) |
void | increment () override |
Private Attributes | |
friend | RandomAccessEnumIteratorBase< ValueType, IsConst > |
size_type | m_size |
friend | InputEnumIteratorBase< ValueType, IsConst > |
CASM_TMP::ConstSwitch< IsConst, value_type > * | m_current_ptr |
bool | m_valid |
step_type | m_step |
typedef RandomAccessEnumIterator<ValueType, IsConst> CASM::RandomAccessEnumeratorBase< ValueType, IsConst >::iterator |
Definition at line 259 of file RandomAccessEnumerator.hh.
|
inherited |
Definition at line 174 of file Enumerator.hh.
typedef std::reverse_iterator<iterator> CASM::RandomAccessEnumeratorBase< ValueType, IsConst >::reverse_iterator |
Definition at line 260 of file RandomAccessEnumerator.hh.
typedef step_type CASM::RandomAccessEnumeratorBase< ValueType, IsConst >::size_type |
Definition at line 261 of file RandomAccessEnumerator.hh.
|
inherited |
Definition at line 107 of file Enumerator.hh.
|
inherited |
Definition at line 173 of file Enumerator.hh.
|
inline |
Definition at line 263 of file RandomAccessEnumerator.hh.
|
inlinevirtual |
Definition at line 266 of file RandomAccessEnumerator.hh.
|
inlineprotectedinherited |
Decrement current step value.
Definition at line 156 of file Enumerator.hh.
|
inlineprotectedinherited |
Increment current step value.
Definition at line 153 of file Enumerator.hh.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
Initialize
Definition at line 197 of file Enumerator.hh.
|
inlineprotectedinherited |
Call if enumeration complete.
Definition at line 159 of file Enumerator.hh.
|
inlineprotectedinherited |
Change the pointer.
Definition at line 215 of file Enumerator.hh.
|
inlineprotected |
Set size value.
Definition at line 322 of file RandomAccessEnumerator.hh.
|
inlineprotectedinherited |
Set current step value.
Definition at line 150 of file Enumerator.hh.
|
inlineprotectedinherited |
Set current step value.
Definition at line 150 of file Enumerator.hh.
|
inlineprotectedinherited |
Used if random access enumerator step is moved into valid range.
Definition at line 162 of file Enumerator.hh.
|
privatepure virtual |
Must be implemented in derived enumerator
|
inline |
Reference to last element in enumerator.
Definition at line 296 of file RandomAccessEnumerator.hh.
|
inline |
Definition at line 274 of file RandomAccessEnumerator.hh.
|
inlineinherited |
Access the current ObjectType by reference.
Definition at line 211 of file Enumerator.hh.
|
inline |
Definition at line 278 of file RandomAccessEnumerator.hh.
|
inline |
Reference to last element in enumerator.
Definition at line 305 of file RandomAccessEnumerator.hh.
|
inline |
Reference to first element in enumerator.
Definition at line 290 of file RandomAccessEnumerator.hh.
|
inlineprivate |
Sets step, current pointer via call to 'at_step', and enumerator validity
Definition at line 336 of file RandomAccessEnumerator.hh.
|
inlineoverrideprivatevirtual |
Pure virtual function inherited from InputEnumeratorBase, needed when incrementing from InputEnumeratorBase*
Implements CASM::InputEnumeratorBase< ValueType, true >.
Definition at line 351 of file RandomAccessEnumerator.hh.
|
inline |
Reference to first element in enumerator.
Definition at line 302 of file RandomAccessEnumerator.hh.
|
pure virtualinherited |
Derived enumerators must implement name, via ENUM_MEMBERS.
Implemented in CASM::LatticeEnumEquivalents, CASM::SuperConfigEnum, CASM::ScelEnumEquivalents, CASM::ScelEnumByProps, CASM::ConfigEnumStrain, CASM::ConfigEnumSiteDoFs, CASM::ConfigEnumRandomOccupations, CASM::ConfigEnumRandomLocal, CASM::ConfigEnumByPermutation, and CASM::ConfigEnumAllOccupations.
|
inherited |
Derived enumerators must implement name, via ENUM_MEMBERS.
|
inline |
Reference an element in enumerator.
Definition at line 308 of file RandomAccessEnumerator.hh.
|
inline |
Definition at line 282 of file RandomAccessEnumerator.hh.
|
inline |
Definition at line 284 of file RandomAccessEnumerator.hh.
|
inline |
Number of elements in enumerator.
Definition at line 287 of file RandomAccessEnumerator.hh.
|
inlinevirtualinherited |
Default Object source just uses step#
Returns:
Definition at line 129 of file Enumerator.hh.
|
inlineinherited |
|
inlineinherited |
Increments with each enumerated object.
Definition at line 115 of file Enumerator.hh.
|
inlineinherited |
Increments with each enumerated object.
Definition at line 115 of file Enumerator.hh.
|
inlineinherited |
Returns false if enumeration is complete.
Definition at line 118 of file Enumerator.hh.
|
inlineinherited |
Returns false if enumeration is complete.
Definition at line 118 of file Enumerator.hh.
|
privateinherited |
Definition at line 198 of file InputEnumerator.hh.
|
privateinherited |
Definition at line 220 of file Enumerator.hh.
|
private |
Definition at line 353 of file RandomAccessEnumerator.hh.
|
privateinherited |
Definition at line 167 of file Enumerator.hh.
|
privateinherited |
Definition at line 165 of file Enumerator.hh.
|
private |
Definition at line 253 of file RandomAccessEnumerator.hh.