CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType > Class Template Referenceabstract

#include <SimpleFormatter.hh>

+ Inheritance diagram for CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >:

Detailed Description

template<typename ObjectType, typename ValueType>
class CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >

Abstract base type to allow containers of DatumEvaluator<ObjectType, ValuesType>

Definition at line 58 of file SimpleFormatter.hh.

Public Types

typedef std::function< ValueType(ObjectType const &object)> ValueF
 Function that evaluates the value. More...
 

Public Member Functions

 DatumEvaluator (std::string _name, ValueF _value_f)
 Construct a non-vectorizable DatumEvaluator. More...
 
std::string const & name () const override
 Name of the evaluated value. More...
 
ValueType value (ObjectType const &object) const
 Value. More...
 
void format_value (DataFormatter< ObjectType > &formatter, ObjectType const &object) const override
 Format each value generated by this evaluator for the object More...
 
bool may_be_vectorized () const override
 Return true if value may be vectorized. This always returns false. More...
 
bool is_fixed_size () const override
 
std::vector< std::string > const & component_names () const override
 
void format_vectorized_value (DataFormatter< ObjectType > &formatter, ObjectType const &object) const override
 
virtual bool is_vector () const =0
 Return true if value may be vectorized. More...
 
virtual bool is_map () const =0
 Return true if value may be mapped. More...
 
virtual void format_mapped_value (DataFormatter< ObjectType > &formatter, ObjectType const &object) const =0
 Format each value generated by this evaluator for the object More...
 

Private Attributes

std::string m_name
 
ValueF m_value_f
 

Member Typedef Documentation

◆ ValueF

template<typename ObjectType , typename ValueType >
typedef std::function<ValueType(ObjectType const &object)> CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >::ValueF

Function that evaluates the value.

Definition at line 62 of file SimpleFormatter.hh.

Constructor & Destructor Documentation

◆ DatumEvaluator()

template<typename ObjectType , typename ValueType >
CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >::DatumEvaluator ( std::string  _name,
ValueF  _value_f 
)

Construct a non-vectorizable DatumEvaluator.

Definition at line 429 of file SimpleFormatter.hh.

Member Function Documentation

◆ component_names()

template<typename ObjectType , typename ValueType >
std::vector<std::string> const& CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >::component_names ( ) const
inlineoverridevirtual

Return strings describing the values evaluated. May be used for csv column headers, json attribute names, etc. depending on DataFormatter<ObjectType> derived implementation

Implements CASM::simpleformatter::BaseDatumEvaluator< ObjectType >.

Definition at line 90 of file SimpleFormatter.hh.

◆ format_mapped_value()

template<typename ObjectType >
virtual void CASM::simpleformatter::BaseDatumEvaluator< ObjectType >::format_mapped_value ( DataFormatter< ObjectType > &  formatter,
ObjectType const &  object 
) const
pure virtualinherited

Format each value generated by this evaluator for the object

◆ format_value()

template<typename ObjectType , typename ValueType >
void CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >::format_value ( DataFormatter< ObjectType > &  formatter,
ObjectType const &  object 
) const
overridevirtual

Format each value generated by this evaluator for the object

Implements CASM::simpleformatter::BaseDatumEvaluator< ObjectType >.

Definition at line 448 of file SimpleFormatter.hh.

◆ format_vectorized_value()

template<typename ObjectType , typename ValueType >
void CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >::format_vectorized_value ( DataFormatter< ObjectType > &  formatter,
ObjectType const &  object 
) const
inlineoverridevirtual

Format each value (subject to this->indices()) generated by this evaluator for the object

Implements CASM::simpleformatter::BaseDatumEvaluator< ObjectType >.

Definition at line 97 of file SimpleFormatter.hh.

◆ is_fixed_size()

template<typename ObjectType , typename ValueType >
bool CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >::is_fixed_size ( ) const
inlineoverridevirtual

Return true if vectorized value is a fixed size, no matter what object is being evaluated. If true, component_names().size() must be equal to the vector size.

Implements CASM::simpleformatter::BaseDatumEvaluator< ObjectType >.

Definition at line 83 of file SimpleFormatter.hh.

◆ is_map()

template<typename ObjectType >
virtual bool CASM::simpleformatter::BaseDatumEvaluator< ObjectType >::is_map ( ) const
pure virtualinherited

Return true if value may be mapped.

◆ is_vector()

template<typename ObjectType >
virtual bool CASM::simpleformatter::BaseDatumEvaluator< ObjectType >::is_vector ( ) const
pure virtualinherited

Return true if value may be vectorized.

◆ may_be_vectorized()

template<typename ObjectType , typename ValueType >
bool CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >::may_be_vectorized ( ) const
inlineoverride

Return true if value may be vectorized. This always returns false.

Definition at line 78 of file SimpleFormatter.hh.

◆ name()

template<typename ObjectType , typename ValueType >
std::string const & CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >::name
overridevirtual

Name of the evaluated value.

Implements CASM::simpleformatter::BaseDatumEvaluator< ObjectType >.

Definition at line 435 of file SimpleFormatter.hh.

◆ value()

template<typename ObjectType , typename ValueType >
ValueType CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >::value ( ObjectType const &  object) const

Value.

Format each value generated by this evaluator for the object

Definition at line 441 of file SimpleFormatter.hh.

Member Data Documentation

◆ m_name

template<typename ObjectType , typename ValueType >
std::string CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >::m_name
private

Definition at line 104 of file SimpleFormatter.hh.

◆ m_value_f

template<typename ObjectType , typename ValueType >
ValueF CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >::m_value_f
private

Definition at line 105 of file SimpleFormatter.hh.


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