CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::ParsingDictionary< T > Class Template Reference

#include <ParsingDictionary.hh>

+ Inheritance diagram for CASM::ParsingDictionary< T >:

Detailed Description

template<typename T>
class CASM::ParsingDictionary< T >

Parsing dictionary for obtaining the correct MoleculeAttribute given a name.

Definition at line 23 of file ParsingDictionary.hh.

Public Types

typedef notstd::unique_cloneable_map< std::string, T > Base
 
typedef Base::key_type key_type
 
typedef Base::value_type value_type
 
typedef Base::size_type size_type
 
typedef Base::iterator iterator
 
typedef Base::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

 ParsingDictionary ()
 
std::unique_ptr< ParsingDictionary< value_type > > clone () const
 
T const & 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, std::function< bool(T const &)> filter, int width=60, int separation=8) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
iterator find (const key_type &key)
 
const_iterator find (const key_type &key) 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...
 
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
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator end () const
 
const_iterator cend () const
 

Private Member Functions

std::pair< iterator, bool > _insert (const value_type &value)
 Copy insert. More...
 
template<typename A , typename B , typename C , typename D , typename E >
int _insert (const unique_map< A, B, C, D, E > &value)
 Dictionary insert. More...
 

Private Attributes

MapType m_map
 
KeyFuncType m_keyfunc
 
ConvertType m_converter
 

Member Typedef Documentation

◆ Base

template<typename T >
typedef notstd::unique_cloneable_map<std::string, T> CASM::ParsingDictionary< T >::Base

Definition at line 25 of file ParsingDictionary.hh.

◆ const_iterator

template<typename T >
typedef Base::const_iterator CASM::ParsingDictionary< T >::const_iterator

Definition at line 31 of file ParsingDictionary.hh.

◆ ConstMapIterator

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 135 of file unique_map.hh.

◆ ConvertType

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 130 of file unique_map.hh.

◆ iterator

template<typename T >
typedef Base::iterator CASM::ParsingDictionary< T >::iterator

Definition at line 30 of file ParsingDictionary.hh.

◆ key_type

template<typename T >
typedef Base::key_type CASM::ParsingDictionary< T >::key_type

Definition at line 27 of file ParsingDictionary.hh.

◆ KeyFuncType

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 128 of file unique_map.hh.

◆ MapIterator

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 134 of file unique_map.hh.

◆ pointer

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 132 of file unique_map.hh.

◆ reference

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 131 of file unique_map.hh.

◆ size_type

template<typename T >
typedef Base::size_type CASM::ParsingDictionary< T >::size_type

Definition at line 29 of file ParsingDictionary.hh.

◆ value_type

template<typename T >
typedef Base::value_type CASM::ParsingDictionary< T >::value_type

Definition at line 28 of file ParsingDictionary.hh.

Constructor & Destructor Documentation

◆ ParsingDictionary()

template<typename T >
CASM::ParsingDictionary< T >::ParsingDictionary ( )
inline

Definition at line 38 of file ParsingDictionary.hh.

Member Function Documentation

◆ _insert() [1/2]

template<typename KeyType , typename ValueType , typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
template<typename A , typename B , typename C , typename D , typename E >
int notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::_insert ( const unique_map< A, B, C, D, E > &  value)
inlineprivateinherited

Dictionary insert.

Definition at line 235 of file unique_map.hh.

◆ _insert() [2/2]

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)
inlineprivateinherited

Copy insert.

Definition at line 227 of file unique_map.hh.

◆ begin() [1/3]

template<typename T >
iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::begin
inline

Definition at line 213 of file unique_map.hh.

◆ begin() [2/3]

template<typename T >
const_iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::begin
inline

Definition at line 215 of file unique_map.hh.

◆ begin() [3/3]

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 215 of file unique_map.hh.

◆ cbegin()

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 217 of file unique_map.hh.

◆ cend()

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 223 of file unique_map.hh.

◆ clear()

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 197 of file unique_map.hh.

◆ clone()

template<typename T >
std::unique_ptr<ParsingDictionary<value_type> > CASM::ParsingDictionary< T >::clone ( ) const
inline

Definition at line 43 of file ParsingDictionary.hh.

◆ contains()

template<typename T >
bool CASM::ParsingDictionary< T >::contains ( const key_type _name) const
inline

True if dictionary contains entry for.

Parameters
_name

Definition at line 52 of file ParsingDictionary.hh.

◆ empty()

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 211 of file unique_map.hh.

◆ end() [1/3]

template<typename T >
iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::end
inline

Definition at line 219 of file unique_map.hh.

◆ end() [2/3]

template<typename T >
const_iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::end
inline

Definition at line 221 of file unique_map.hh.

◆ end() [3/3]

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 221 of file unique_map.hh.

◆ erase() [1/3]

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 207 of file unique_map.hh.

◆ erase() [2/3]

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 203 of file unique_map.hh.

◆ erase() [3/3]

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 199 of file unique_map.hh.

◆ find() [1/4]

template<typename T >
iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::find
inline

Definition at line 191 of file unique_map.hh.

◆ find() [2/4]

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 191 of file unique_map.hh.

◆ find() [3/4]

template<typename T >
const_iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::find
inline

Definition at line 193 of file unique_map.hh.

◆ find() [4/4]

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 193 of file unique_map.hh.

◆ insert() [1/10]

template<typename T >
std::pair<iterator, bool> notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::insert
inline

Insert single value.

Definition at line 149 of file unique_map.hh.

◆ insert() [2/10]

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 149 of file unique_map.hh.

◆ insert() [3/10]

template<typename T >
template<typename... ValuesOrMaps>
void notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::insert ( typename...  ValuesOrMaps)
inline

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

Definition at line 169 of file unique_map.hh.

◆ insert() [4/10]

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 169 of file unique_map.hh.

◆ insert() [5/10]

template<typename T >
iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::insert
inline

Insert single value.

Definition at line 154 of file unique_map.hh.

◆ insert() [6/10]

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 154 of file unique_map.hh.

◆ insert() [7/10]

template<typename T >
template<typename Iterator >
void notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::insert ( typename Iterator  )
inline

Iterator range insert.

Definition at line 175 of file unique_map.hh.

◆ insert() [8/10]

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 175 of file unique_map.hh.

◆ insert() [9/10]

template<typename T >
iterator notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::insert
inline

Insert single value.

Definition at line 161 of file unique_map.hh.

◆ insert() [10/10]

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 161 of file unique_map.hh.

◆ key()

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 146 of file unique_map.hh.

◆ lookup()

template<typename T >
T const & CASM::ParsingDictionary< T >::lookup ( const key_type _name) const

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

Equivalent to find, but throw error with suggestion if _name not found.

Parameters
_namenot found

Definition at line 66 of file ParsingDictionary.hh.

◆ operator[]()

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 183 of file unique_map.hh.

◆ print_help()

template<typename T >
void CASM::ParsingDictionary< T >::print_help ( std::ostream &  _stream,
std::function< bool(T const &)>  filter,
int  width = 60,
int  separation = 8 
) const

Definition at line 94 of file ParsingDictionary.hh.

◆ size()

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 209 of file unique_map.hh.

Member Data Documentation

◆ m_converter

template<typename KeyType , typename ValueType , typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
ConvertType notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::m_converter
privateinherited

Definition at line 242 of file unique_map.hh.

◆ m_keyfunc

template<typename KeyType , typename ValueType , typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
KeyFuncType notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::m_keyfunc
privateinherited

Definition at line 241 of file unique_map.hh.

◆ m_map

template<typename KeyType , typename ValueType , typename MapType = std::map<KeyType, ValueType>, typename TransformFunction = GetSecond<MapType>, typename ConstTransformFunction = GetSecondConst<MapType>>
MapType notstd::unique_map< KeyType, ValueType, MapType, TransformFunction, ConstTransformFunction >::m_map
privateinherited

Definition at line 240 of file unique_map.hh.


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