CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType > Class Template Reference

#include <DataFormatter.hh>

+ Inheritance diagram for CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType >:

Detailed Description

template<typename _DataObject, typename _DatumFormatterType = BaseDatumFormatter<_DataObject>>
class CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType >

Parsing dictionary for constructing a DataFormatter<DataObject> object.

Definition at line 67 of file DataFormatter.hh.

Public Types

typedef _DataObject DataObject
 
typedef _DatumFormatterType DatumFormatterType
 
typedef
notstd::unique_cloneable_map
< std::string,
DatumFormatterType
UniqueMapType
 
typedef UniqueMapType::key_type key_type
 
typedef UniqueMapType::value_type value_type
 
typedef UniqueMapType::size_type size_type
 
typedef UniqueMapType::iterator iterator
 
typedef
UniqueMapType::const_iterator 
const_iterator
 
typedef std::function< KeyType(const
ValueType &)> 
KeyFuncType
 
typedef std::function
< typename
MapType::mapped_type(const
ValueType &)> 
ConvertType
 
typedef ValueType & reference
 
typedef ValueType * pointer
 
typedef MapType::iterator MapIterator
 
typedef MapType::const_iterator ConstMapIterator
 

Public Member Functions

 DataFormatterDictionary ()
 
const_iterator lookup (const key_type &_name) const
 Equivalent to find, but set 'home' and throws error with suggestion if. More...
 
bool contains (const key_type &_name) const
 True if dictionary contains entry for. More...
 
void print_help (std::ostream &_stream, typename BaseDatumFormatter< DataObject >::FormatterType ftype, int width=60, int separation=8) const
 Generates formatted help using the 'name' and 'description' of all contained BaseDatumFormatter. More...
 
DataFormatter< DataObjectparse (const std::string &input) const
 Use the vector of strings to build a DataFormatter<DataObject> More...
 
DataFormatter< DataObjectparse (const std::vector< std::string > &input) const
 Use a single string to build a DataFormatter<DataObject> More...
 
key_type key (const value_type &value) const
 
std::pair< iterator, bool > insert (const value_type &value)
 Insert single value. More...
 
iterator insert (const_iterator hint, const value_type &value)
 Insert single value. More...
 
iterator insert (iterator hint, const value_type &value)
 Insert single value. More...
 
template<typename... ValuesOrMaps>
void insert (const ValuesOrMaps &...more)
 Variadic insert accepts as const UniqueMap& or const ValueType&. More...
 
template<typename Iterator >
void insert (Iterator begin, Iterator end, typename CASM::CASM_TMP::enable_if_iterator< Iterator >::type *=nullptr)
 Iterator range insert. More...
 
value_typeoperator[] (const key_type &key)
 
iterator find (const key_type &key)
 
const_iterator find (const key_type &key) const
 
void clear ()
 
iterator erase (const_iterator pos)
 
iterator erase (const_iterator first, const_iterator last)
 
size_type erase (const key_type &key)
 
size_type size () const
 
bool empty () const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cend () const
 

Member Typedef Documentation

template<typename _DataObject, typename _DatumFormatterType = BaseDatumFormatter<_DataObject>>
typedef UniqueMapType::const_iterator CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType >::const_iterator

Definition at line 637 of file DataFormatter.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
typedef MapType::const_iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::ConstMapIterator
inherited

Definition at line 153 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
typedef std::function<typename MapType::mapped_type(const ValueType &)> notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::ConvertType
inherited

Definition at line 148 of file unique_map.hh.

template<typename _DataObject, typename _DatumFormatterType = BaseDatumFormatter<_DataObject>>
typedef _DataObject CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType >::DataObject

Definition at line 630 of file DataFormatter.hh.

template<typename _DataObject, typename _DatumFormatterType = BaseDatumFormatter<_DataObject>>
typedef _DatumFormatterType CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType >::DatumFormatterType

Definition at line 631 of file DataFormatter.hh.

template<typename _DataObject, typename _DatumFormatterType = BaseDatumFormatter<_DataObject>>
typedef UniqueMapType::iterator CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType >::iterator

Definition at line 636 of file DataFormatter.hh.

template<typename _DataObject, typename _DatumFormatterType = BaseDatumFormatter<_DataObject>>
typedef UniqueMapType::key_type CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType >::key_type

Definition at line 633 of file DataFormatter.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
typedef std::function<KeyType(const ValueType &)> notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::KeyFuncType
inherited

Definition at line 147 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
typedef MapType::iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::MapIterator
inherited

Definition at line 152 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
typedef ValueType* notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::pointer
inherited

Definition at line 150 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
typedef ValueType& notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::reference
inherited

Definition at line 149 of file unique_map.hh.

template<typename _DataObject, typename _DatumFormatterType = BaseDatumFormatter<_DataObject>>
typedef UniqueMapType::size_type CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType >::size_type

Definition at line 635 of file DataFormatter.hh.

template<typename _DataObject, typename _DatumFormatterType = BaseDatumFormatter<_DataObject>>
typedef notstd::unique_cloneable_map<std::string, DatumFormatterType> CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType >::UniqueMapType

Definition at line 632 of file DataFormatter.hh.

template<typename _DataObject, typename _DatumFormatterType = BaseDatumFormatter<_DataObject>>
typedef UniqueMapType::value_type CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType >::value_type

Definition at line 634 of file DataFormatter.hh.

Constructor & Destructor Documentation

template<typename _DataObject, typename _DatumFormatterType = BaseDatumFormatter<_DataObject>>
CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType >::DataFormatterDictionary ( )
inline

Definition at line 639 of file DataFormatter.hh.

Member Function Documentation

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::begin ( )
inlineinherited

Definition at line 247 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
const_iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::begin ( ) const
inlineinherited

Definition at line 251 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
const_iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::cbegin ( ) const
inlineinherited

Definition at line 255 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
const_iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::cend ( ) const
inlineinherited

Definition at line 267 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
void notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::clear ( )
inlineinherited

Definition at line 223 of file unique_map.hh.

template<typename _DataObject, typename _DatumFormatterType = BaseDatumFormatter<_DataObject>>
bool CASM::DataFormatterDictionary< _DataObject, _DatumFormatterType >::contains ( const key_type _name) const
inline

True if dictionary contains entry for.

Parameters
_name

Definition at line 679 of file DataFormatter.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
bool notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::empty ( ) const
inlineinherited

Definition at line 243 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::end ( )
inlineinherited

Definition at line 259 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
const_iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::end ( ) const
inlineinherited

Definition at line 263 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::erase ( const_iterator  pos)
inlineinherited

Definition at line 227 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::erase ( const_iterator  first,
const_iterator  last 
)
inlineinherited

Definition at line 231 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
size_type notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::erase ( const key_type key)
inlineinherited

Definition at line 235 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::find ( const key_type key)
inlineinherited

Definition at line 215 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
const_iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::find ( const key_type key) const
inlineinherited

Definition at line 219 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
std::pair<iterator, bool> notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::insert ( const value_type value)
inlineinherited

Insert single value.

Definition at line 169 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::insert ( const_iterator  hint,
const value_type value 
)
inlineinherited

Insert single value.

Definition at line 174 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::insert ( iterator  hint,
const value_type value 
)
inlineinherited

Insert single value.

Definition at line 184 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
template<typename... ValuesOrMaps>
void notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::insert ( const ValuesOrMaps &...  more)
inlineinherited

Variadic insert accepts as const UniqueMap& or const ValueType&.

Definition at line 195 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
template<typename Iterator >
void notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::insert ( Iterator  begin,
Iterator  end,
typename CASM::CASM_TMP::enable_if_iterator< Iterator >::type *  = nullptr 
)
inlineinherited

Iterator range insert.

Definition at line 201 of file unique_map.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
key_type notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::key ( const value_type value) const
inlineinherited

Definition at line 164 of file unique_map.hh.

template<typename DataObject , typename DatumFormatterType >
DataFormatterDictionary< DataObject, DatumFormatterType >::const_iterator CASM::DataFormatterDictionary< DataObject, DatumFormatterType >::lookup ( const key_type _name) const

Equivalent to find, but set 'home' and throws error with suggestion if.

Parameters
_namenot found

Definition at line 283 of file DataFormatter_impl.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
value_type& notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::operator[] ( const key_type key)
inlineinherited

Definition at line 207 of file unique_map.hh.

template<typename DataObject , typename DatumFormatterType >
DataFormatter< DataObject > CASM::DataFormatterDictionary< DataObject, DatumFormatterType >::parse ( const std::string &  input) const

Use the vector of strings to build a DataFormatter<DataObject>

Use a single string to build a DataFormatter<DataObject>

Expects string of "formattername(argument1,argument2,...) formattername(argument1,argument2,...) ..."

Uses DataFormatterDictionary<DataObject>::lookup to suggest alternatives if exact request not found.

Definition at line 380 of file DataFormatter_impl.hh.

template<typename DataObject , typename DatumFormatterType >
DataFormatter< DataObject > CASM::DataFormatterDictionary< DataObject, DatumFormatterType >::parse ( const std::vector< std::string > &  input) const

Use a single string to build a DataFormatter<DataObject>

Use the vector of strings to build a DataFormatter<DataObject>

Expects vector of "formattername(argument1,argument2,...)"

Uses DataFormatterDictionary<DataObject>::lookup to suggest alternatives if exact request not found.

Definition at line 358 of file DataFormatter_impl.hh.

template<typename DataObject , typename DatumFormatterType >
void CASM::DataFormatterDictionary< DataObject, DatumFormatterType >::print_help ( std::ostream &  _stream,
typename BaseDatumFormatter< DataObject >::FormatterType  ftype,
int  width = 60,
int  separation = 8 
) const

Generates formatted help using the 'name' and 'description' of all contained BaseDatumFormatter.

Definition at line 318 of file DataFormatter_impl.hh.

template<typename KeyType, typename ValueType, typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
size_type notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::size ( ) const
inlineinherited

Definition at line 239 of file unique_map.hh.


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