CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::ClexParamPack_impl::BaseKey Class Referenceabstract

#include <ClexParamPack.hh>

+ Inheritance diagram for CASM::ClexParamPack_impl::BaseKey:

Detailed Description

BaseKey is base class from which all ClexParamKey implementation classes inherit. Hides implementation-specific access attributes through an abstract interface. A ClexParamKey object manages access for a particular type of data valuess. Additional specification of referenced data can be provided via linear or pair indices as necessary.

Definition at line 39 of file ClexParamPack.hh.

Public Member Functions

 BaseKey (std::string const &_name, bool _standalone, std::vector< Index > const &_offset={}, std::vector< Index > const &_stride={})
 Must be constructed with at least a name. More...
 
virtual ~BaseKey ()
 Abstract class must define virtual destructor. More...
 
std::string const & name () const
 Name of this Key, should be descriptive of managed data. Ex.: "disp_var" of "magspin_site_basis". More...
 
template<typename... Args>
void set_identifiers (Args const &... args)
 Specify supplemental identifiers, either via linear indices or pair indices. Internally, identifiers are always passed as linear indices. The number and specification of identifiers depends on derived ClexParamKey implementation. Linear identifiers should be passed as an integral value (Index, int, etc) pair index identifiers must be passed as std::pair<Index,Index> More...
 
std::unique_ptr< BaseKeyclone () const
 Clone the ClexParamKey. More...
 
bool standalone () const
 Returns true if key refers directly to managed data, false if it refers to values derived from managed data. More...
 

Protected Member Functions

Index _l (Index i) const
 Returns i'th linear index identifier. More...
 
template<typename T , typename... Args>
void _set_identifiers (Index i, T const &_val, Args const &... args)
 Recursive unrolling of variadic template to set all identifiers. More...
 
void _set_identifiers (Index i, Index _ind)
 Overload for linear indexed identifier. More...
 
void _set_identifiers (Index i, std::pair< Index, Index > _inds)
 Overload for pair indexed identifier. More...
 
virtual BaseKey_clone () const =0
 Clone the ClexParamKey. More...
 

Protected Attributes

std::vector< Indexm_offset
 
std::vector< Indexm_stride
 
std::vector< Indexm_identifiers
 

Private Attributes

std::string m_name
 
bool m_standalone
 

Constructor & Destructor Documentation

◆ BaseKey()

CASM::ClexParamPack_impl::BaseKey::BaseKey ( std::string const &  _name,
bool  _standalone,
std::vector< Index > const &  _offset = {},
std::vector< Index > const &  _stride = {} 
)
inline

Must be constructed with at least a name.

Parameters
_name{ unique name that describes managed data }
_standalone{ true if key refers directly to managed data, false if refers to value derived from managed data }
_offset{ list of constant offsets for each supplemental linear identifier index }
_stride{ list of strides to convert supplemental pair identifier indices to linear indices}

Definition at line 48 of file ClexParamPack.hh.

◆ ~BaseKey()

virtual CASM::ClexParamPack_impl::BaseKey::~BaseKey ( )
inlinevirtual

Abstract class must define virtual destructor.

Definition at line 58 of file ClexParamPack.hh.

Member Function Documentation

◆ _clone()

virtual BaseKey* CASM::ClexParamPack_impl::BaseKey::_clone ( ) const
protectedpure virtual

◆ _l()

Index CASM::ClexParamPack_impl::BaseKey::_l ( Index  i) const
inlineprotected

Returns i'th linear index identifier.

Definition at line 86 of file ClexParamPack.hh.

◆ _set_identifiers() [1/3]

void CASM::ClexParamPack_impl::BaseKey::_set_identifiers ( Index  i,
Index  _ind 
)
inlineprotected

Overload for linear indexed identifier.

Definition at line 96 of file ClexParamPack.hh.

◆ _set_identifiers() [2/3]

void CASM::ClexParamPack_impl::BaseKey::_set_identifiers ( Index  i,
std::pair< Index, Index _inds 
)
inlineprotected

Overload for pair indexed identifier.

Definition at line 101 of file ClexParamPack.hh.

◆ _set_identifiers() [3/3]

template<typename T , typename... Args>
void CASM::ClexParamPack_impl::BaseKey::_set_identifiers ( Index  i,
T const &  _val,
Args const &...  args 
)
inlineprotected

Recursive unrolling of variadic template to set all identifiers.

Definition at line 90 of file ClexParamPack.hh.

◆ clone()

std::unique_ptr<BaseKey> CASM::ClexParamPack_impl::BaseKey::clone ( ) const
inline

Clone the ClexParamKey.

Definition at line 76 of file ClexParamPack.hh.

◆ name()

std::string const& CASM::ClexParamPack_impl::BaseKey::name ( ) const
inline

Name of this Key, should be descriptive of managed data. Ex.: "disp_var" of "magspin_site_basis".

Definition at line 62 of file ClexParamPack.hh.

◆ set_identifiers()

template<typename... Args>
void CASM::ClexParamPack_impl::BaseKey::set_identifiers ( Args const &...  args)
inline

Specify supplemental identifiers, either via linear indices or pair indices. Internally, identifiers are always passed as linear indices. The number and specification of identifiers depends on derived ClexParamKey implementation. Linear identifiers should be passed as an integral value (Index, int, etc) pair index identifiers must be passed as std::pair<Index,Index>

Definition at line 71 of file ClexParamPack.hh.

◆ standalone()

bool CASM::ClexParamPack_impl::BaseKey::standalone ( ) const
inline

Returns true if key refers directly to managed data, false if it refers to values derived from managed data.

Definition at line 82 of file ClexParamPack.hh.

Member Data Documentation

◆ m_identifiers

std::vector<Index> CASM::ClexParamPack_impl::BaseKey::m_identifiers
protected

Definition at line 110 of file ClexParamPack.hh.

◆ m_name

std::string CASM::ClexParamPack_impl::BaseKey::m_name
private

Definition at line 113 of file ClexParamPack.hh.

◆ m_offset

std::vector<Index> CASM::ClexParamPack_impl::BaseKey::m_offset
protected

Definition at line 108 of file ClexParamPack.hh.

◆ m_standalone

bool CASM::ClexParamPack_impl::BaseKey::m_standalone
private

Definition at line 114 of file ClexParamPack.hh.

◆ m_stride

std::vector<Index> CASM::ClexParamPack_impl::BaseKey::m_stride
protected

Definition at line 109 of file ClexParamPack.hh.


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