CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
DataFormatter

Detailed Description

Functions and classes related to calculating properties and formatting data.

DataFormatter act on ranges of 'DataObject', extracting or calculating data, and outputting it in various formats (csv, JSON, Eigen::MatrixXd, etc.)

A DataFormatter contains a set of 'DatumFormatter', class methods derived from BaseDatumFormatter, specialized to extract or calculate particular properties. A range of intermediate classes (

See also
Basic Types) exist with the basic implementation details for extracting boolean, scalar, vector, matrix, etc. data, ready to be specialized for a particular property.

DatumFormatters can be constructed and initialized as normal c++ types, but they must also provide an implementation ::BaseDatumFormatter::parse_args that enables initialization from a string command.

The set of DatumFormatter that exist for operating on a particular type of DataObject are stored in a DataFormatterDictionary. The DataFormatterDictionary can parse a string or collection of strings used to specify particular DatumFormatters and any required or optional arguments, and construct and initialize a DataFormatter containing those DatumFormatters. This enables the functionality available through the 'casm query' and 'casm select' commands.

For the set of DatumFormatter available to act on Configuration,

See also
ConfigIO. There currently only exist DatumFormatter that act on Configuration, but DatumFormatter acting on other DataObjects are planned.

Modules

 Basic Types
 Base types for creating data formatters.
 
 DataFormatterOperator
 Operators on other DatumFormatters.
 
 Configuration Queries
 Data formatters that return Configuration properties.
 

Classes

singleton  CASM::DataFormatter< _DataObject >
 Extract data from objects of 'DataObject' class. More...
 
class  CASM::FormattedPrintable
 Abstract base class to enable generic formatting. More...
 
class  CASM::DataFormatter< _DataObject >::FormattedIteratorPair< IteratorType >
 Implements generic formatting member functions for ranges of data objects. More...
 
class  CASM::DataFormatter< _DataObject >::FormattedObject
 Implements generic formatting member functions for individual data objects. More...
 
class  CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType >
 Parsing dictionary for constructing a DataFormatter<DataObject> object. More...
 
class  CASM::DataStream
 
class  CASM::MatrixXdDataStream
 
class  CASM::LabeledMatrixXdDataStream
 

Typedefs

template<typename DataObject >
using CASM::StringAttributeDictionary = DataFormatterDictionary< DataObject, StringAttribute< DataObject > >
 Template to be specialized for constructing dictionaries for particular DataObject. More...
 
template<typename DataObject >
using CASM::BooleanAttributeDictionary = DataFormatterDictionary< DataObject, BooleanAttribute< DataObject > >
 Template to be specialized for constructing dictionaries for particular DataObject. More...
 
template<typename DataObject >
using CASM::IntegerAttributeDictionary = DataFormatterDictionary< DataObject, IntegerAttribute< DataObject > >
 Template to be specialized for constructing dictionaries for particular DataObject. More...
 
template<typename DataObject >
using CASM::ScalarAttributeDictionary = DataFormatterDictionary< DataObject, ScalarAttribute< DataObject > >
 Template to be specialized for constructing dictionaries for particular DataObject. More...
 
template<typename DataObject >
using CASM::VectorXdAttributeDictionary = DataFormatterDictionary< DataObject, VectorXdAttribute< DataObject > >
 Template to be specialized for constructing dictionaries for particular DataObject. More...
 

Enumerations

enum  CASM::DataStream::DataStreamTraits { CASM::DataStream::none = 0, CASM::DataStream::skipfail = (1u << 0), CASM::DataStream::failbit = (1u << 1) }
 

Functions

template<typename DataObject >
DatumFormatterAlias< DataObject > CASM::datum_formatter_alias (const std::string &_name, const std::string &_command, const DataFormatterDictionary< DataObject > &_dict, const std::string &_help="")
 Make a DatumFormatterAlias. More...
 
template<typename DataObject >
DatumFormatterAlias< DataObject > CASM::datum_formatter_alias (const std::string &_name, const BaseDatumFormatter< DataObject > &_inside, const std::string &_help="")
 Make a DatumFormatterAlias. More...
 
template<typename DataObject >
StringAttributeDictionary
< DataObject > 
CASM::make_string_dictionary ()
 Template to be specialized for constructing dictionaries for particular DataObject. More...
 
template<typename DataObject >
BooleanAttributeDictionary
< DataObject > 
CASM::make_boolean_dictionary ()
 Template to be specialized for constructing dictionaries for particular DataObject. More...
 
template<typename DataObject >
IntegerAttributeDictionary
< DataObject > 
CASM::make_integer_dictionary ()
 Template to be specialized for constructing dictionaries for particular DataObject. More...
 
template<typename DataObject >
ScalarAttributeDictionary
< DataObject > 
CASM::make_scalar_dictionary ()
 Template to be specialized for constructing dictionaries for particular DataObject. More...
 
template<typename DataObject >
VectorXdAttributeDictionary
< DataObject > 
CASM::make_vectorxd_dictionary ()
 Template to be specialized for constructing dictionaries for particular DataObject. More...
 

Typedef Documentation

template<typename DataObject >
using CASM::BooleanAttributeDictionary = typedef DataFormatterDictionary<DataObject, BooleanAttribute<DataObject> >

Template to be specialized for constructing dictionaries for particular DataObject.

Definition at line 1112 of file DataFormatterTools.hh.

template<typename DataObject >
using CASM::IntegerAttributeDictionary = typedef DataFormatterDictionary<DataObject, IntegerAttribute<DataObject> >

Template to be specialized for constructing dictionaries for particular DataObject.

Definition at line 1134 of file DataFormatterTools.hh.

template<typename DataObject >
using CASM::ScalarAttributeDictionary = typedef DataFormatterDictionary<DataObject, ScalarAttribute<DataObject> >

Template to be specialized for constructing dictionaries for particular DataObject.

Definition at line 1156 of file DataFormatterTools.hh.

template<typename DataObject >
using CASM::StringAttributeDictionary = typedef DataFormatterDictionary<DataObject, StringAttribute<DataObject> >

Template to be specialized for constructing dictionaries for particular DataObject.

Definition at line 1090 of file DataFormatterTools.hh.

template<typename DataObject >
using CASM::VectorXdAttributeDictionary = typedef DataFormatterDictionary<DataObject, VectorXdAttribute<DataObject> >

Template to be specialized for constructing dictionaries for particular DataObject.

Definition at line 1178 of file DataFormatterTools.hh.

Enumeration Type Documentation

Enumerator
none 
skipfail 
failbit 

Definition at line 13 of file DataStream.hh.

Function Documentation

template<typename DataObject >
DatumFormatterAlias<DataObject> CASM::datum_formatter_alias ( const std::string &  _name,
const std::string &  _command,
const DataFormatterDictionary< DataObject > &  _dict,
const std::string &  _help = "" 
)

Make a DatumFormatterAlias.

Definition at line 620 of file DataFormatterTools.hh.

template<typename DataObject >
DatumFormatterAlias<DataObject> CASM::datum_formatter_alias ( const std::string &  _name,
const BaseDatumFormatter< DataObject > &  _inside,
const std::string &  _help = "" 
)

Make a DatumFormatterAlias.

Definition at line 633 of file DataFormatterTools.hh.

template<typename DataObject >
BooleanAttributeDictionary<DataObject> CASM::make_boolean_dictionary ( )

Template to be specialized for constructing dictionaries for particular DataObject.

template<typename DataObject >
IntegerAttributeDictionary<DataObject> CASM::make_integer_dictionary ( )

Template to be specialized for constructing dictionaries for particular DataObject.

template<typename DataObject >
ScalarAttributeDictionary<DataObject> CASM::make_scalar_dictionary ( )

Template to be specialized for constructing dictionaries for particular DataObject.

template<typename DataObject >
StringAttributeDictionary<DataObject> CASM::make_string_dictionary ( )

Template to be specialized for constructing dictionaries for particular DataObject.

template<typename DataObject >
VectorXdAttributeDictionary<DataObject> CASM::make_vectorxd_dictionary ( )

Template to be specialized for constructing dictionaries for particular DataObject.