CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <SimpleFormatter.hh>
Generates name, value pairs for properties of an object
Notes:
Definition at line 120 of file SimpleFormatter.hh.
Public Types | |
typedef std::function< VectorizedValueType(ObjectType const &)> | FixedVectorizedValueF |
Function that evaluates the vectorized value and sets component names. More... | |
typedef std::function< VectorizedValueType(ObjectType const &, std::vector< std::string > &)> | DynamicVectorizedValueF |
Function that evaluates the vectorized value and sets component names. More... | |
Public Member Functions | |
VectorizedDatumEvaluator (DynamicVectorizedValueF _dynamic_vectorized_value_f) | |
Construct a vectorizable, variable size, DatumEvaluator. More... | |
VectorizedDatumEvaluator (std::vector< std::string > _component_names, FixedVectorizedValueF _vectorized_value_f) | |
bool | may_be_vectorized () const override |
Return true if value may be vectorized. This always returns true. More... | |
bool | is_fixed_size () const override |
VectorizedValueType | vectorized_value (ObjectType const &object) const |
Vectorized value. More... | |
std::vector< std::string > const & | component_names () const override |
void | format_vectorized_value (DataFormatter< ObjectType > &formatter, ObjectType const &object) const override |
virtual std::string const & | name () const =0 |
Name of the evaluated value. More... | |
virtual void | format_value (DataFormatter< ObjectType > &formatter, ObjectType const &object) const =0 |
Format each value generated by this evaluator for the object More... | |
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 | |
DynamicVectorizedValueF | m_dynamic_vectorized_value_f |
FixedVectorizedValueF | m_fixed_vectorized_value_f |
bool | m_is_fixed_size |
std::vector< std::string > | m_component_names |
typedef std::function<VectorizedValueType(ObjectType const &, std::vector<std::string> &)> CASM::simpleformatter::VectorizedDatumEvaluator< ObjectType, VectorizedValueType >::DynamicVectorizedValueF |
Function that evaluates the vectorized value and sets component names.
Definition at line 131 of file SimpleFormatter.hh.
typedef std::function<VectorizedValueType(ObjectType const &)> CASM::simpleformatter::VectorizedDatumEvaluator< ObjectType, VectorizedValueType >::FixedVectorizedValueF |
Function that evaluates the vectorized value and sets component names.
Definition at line 126 of file SimpleFormatter.hh.
CASM::simpleformatter::VectorizedDatumEvaluator< ObjectType, VectorizedValueType >::VectorizedDatumEvaluator | ( | DynamicVectorizedValueF | _dynamic_vectorized_value_f | ) |
Construct a vectorizable, variable size, DatumEvaluator.
Definition at line 455 of file SimpleFormatter.hh.
CASM::simpleformatter::VectorizedDatumEvaluator< ObjectType, VectorizedValueType >::VectorizedDatumEvaluator | ( | std::vector< std::string > | _component_names, |
FixedVectorizedValueF | _vectorized_value_f | ||
) |
Construct vectorizable, fixed size (equal to _component_names.size()), DatumEvaluator
|
inlineoverridevirtual |
Return strings describing the values evaluated. May be used for csv column headers, json attribute names, etc. depending on DataFormatter<ObjectType> derived implementation
If this->is_fixed_size()==true: this will be valid after construction and unchanging. Else: this will be valid and updated after each call to vectorized_value.
Implements CASM::simpleformatter::BaseDatumEvaluator< ObjectType >.
Definition at line 160 of file SimpleFormatter.hh.
|
pure virtualinherited |
Format each value generated by this evaluator for the object
|
pure virtualinherited |
Format each value generated by this evaluator for the object
Implemented in CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >.
|
overridevirtual |
Format each value (subject to this->indices()) generated by this evaluator for the object
Equivalent to the following:
Format each value (subject to this->indices()) generated by this evaluator for the object
Implements CASM::simpleformatter::BaseDatumEvaluator< ObjectType >.
Definition at line 485 of file SimpleFormatter.hh.
|
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 147 of file SimpleFormatter.hh.
|
pure virtualinherited |
Return true if value may be mapped.
|
pure virtualinherited |
Return true if value may be vectorized.
|
inlineoverride |
Return true if value may be vectorized. This always returns true.
Definition at line 142 of file SimpleFormatter.hh.
|
pure virtualinherited |
Name of the evaluated value.
Implemented in CASM::simpleformatter::DatumEvaluator< ObjectType, ValueType >.
VectorizedValueType CASM::simpleformatter::VectorizedDatumEvaluator< ObjectType, ValueType, VectorizedValueType >::vectorized_value | ( | ObjectType const & | object | ) | const |
Vectorized value.
Vectorized value (is this->is_fixed_size()==false, will update component_names)
Definition at line 474 of file SimpleFormatter.hh.
|
mutableprivate |
Definition at line 183 of file SimpleFormatter.hh.
|
private |
Definition at line 180 of file SimpleFormatter.hh.
|
private |
Definition at line 181 of file SimpleFormatter.hh.
|
private |
Definition at line 182 of file SimpleFormatter.hh.