CHROMA
|
Main enum std::map holder. More...
#include <enum_type_map.h>
Classes | |
struct | EnumLookupException |
struct | StringLookupException |
Public Types | |
typedef std::map< std::string, EnumType > | Str2Enum |
typedef std::map< EnumType, std::string > | Enum2Str |
typedef std::map< std::string, EnumType >::iterator | Str2EnumIterator |
typedef std::map< EnumType, std::string >::iterator | Enum2StrIterator |
Public Member Functions | |
EnumTypeMap () | |
bool | registerPair (const std::string &s, const EnumType t) |
Function registers a std::string/enum pair. More... | |
EnumType | lookUpEnum (const std::string &s) |
Look up an enum based on a std::string. More... | |
std::string | lookUpString (const EnumType &t) |
Look up a std::string from an enum. More... | |
void | read (const std::string &typeIDString, XMLReader &xml_in, const std::string &path, EnumType &t) |
"Reader" More... | |
void | write (const std::string &typeIDString, XMLWriter &xml_out, const std::string &path, const EnumType &t) |
Writer. More... | |
void | read (const std::string &typeIDString, BinaryReader &bin_in, EnumType &t) |
"Reader" More... | |
void | write (const std::string &typeIDString, BinaryWriter &bin_out, const EnumType &t) |
Writer. More... | |
Private Member Functions | |
EnumTypeMap (const EnumTypeMap< EnumType > &t) | |
void | dumpMapStrings (const std::string &typeIDString) |
Private Attributes | |
Enum2Str | enum_map |
Str2Enum | str_map |
Main enum std::map holder.
Enums used throughout the code and their initialization via std::maps. This is used for IO.
Definition at line 26 of file enum_type_map.h.
typedef std::map<EnumType, std::string> Chroma::EnumTypeMap< EnumType >::Enum2Str |
Definition at line 30 of file enum_type_map.h.
typedef std::map<EnumType, std::string>::iterator Chroma::EnumTypeMap< EnumType >::Enum2StrIterator |
Definition at line 32 of file enum_type_map.h.
typedef std::map<std::string, EnumType> Chroma::EnumTypeMap< EnumType >::Str2Enum |
Definition at line 29 of file enum_type_map.h.
typedef std::map<std::string, EnumType>::iterator Chroma::EnumTypeMap< EnumType >::Str2EnumIterator |
Definition at line 31 of file enum_type_map.h.
|
inlineprivate |
Definition at line 36 of file enum_type_map.h.
|
inline |
Definition at line 59 of file enum_type_map.h.
|
inlineprivate |
Definition at line 48 of file enum_type_map.h.
References Chroma::EnumTypeMap< EnumType >::enum_map, it, and Chroma::QPhiXSolverTypeEnv::typeIDString.
Referenced by Chroma::EnumTypeMap< EnumType >::read(), and Chroma::EnumTypeMap< EnumType >::write().
|
inline |
Look up an enum based on a std::string.
Definition at line 96 of file enum_type_map.h.
References it, Chroma::s(), Chroma::EnumTypeMap< EnumType >::str_map, and t.
Referenced by Chroma::EnumTypeMap< EnumType >::read().
|
inline |
Look up a std::string from an enum.
Definition at line 113 of file enum_type_map.h.
References Chroma::EnumTypeMap< EnumType >::enum_map, it, Chroma::s(), and t.
Referenced by Chroma::EnumTypeMap< EnumType >::write().
|
inline |
"Reader"
Definition at line 182 of file enum_type_map.h.
References Chroma::EnumTypeMap< EnumType >::dumpMapStrings(), Chroma::EnumTypeMap< EnumType >::lookUpEnum(), t, Chroma::QPhiXSolverTypeEnv::typeIDString, and Chroma::EnumTypeMap< EnumType >::EnumLookupException::val_str.
|
inline |
"Reader"
Definition at line 129 of file enum_type_map.h.
References Chroma::EnumTypeMap< EnumType >::dumpMapStrings(), Chroma::EnumTypeMap< EnumType >::lookUpEnum(), Chroma::read(), t, Chroma::QPhiXSolverTypeEnv::typeIDString, and Chroma::EnumTypeMap< EnumType >::EnumLookupException::val_str.
|
inline |
Function registers a std::string/enum pair.
Enum-String pairs are initialised when the relevant env's "registered" boolean is set, and this may well be before QDP is initialised. So it is not safe to call QDPIO::cerr in this pair registration function.... Printing to std::cerr works tho. So I add it. Message should only be generated if registration fails which is most likely to be due to a duplicate key. This is a useful check that I haven't left duplicates in the registerAll() functions.
Definition at line 73 of file enum_type_map.h.
References Chroma::EnumTypeMap< EnumType >::enum_map, Chroma::s(), Chroma::EnumTypeMap< EnumType >::str_map, and t.
|
inline |
Writer.
Definition at line 208 of file enum_type_map.h.
References Chroma::EnumTypeMap< EnumType >::dumpMapStrings(), Chroma::EnumTypeMap< EnumType >::lookUpString(), t, and Chroma::QPhiXSolverTypeEnv::typeIDString.
|
inline |
Writer.
Definition at line 156 of file enum_type_map.h.
References Chroma::EnumTypeMap< EnumType >::dumpMapStrings(), Chroma::EnumTypeMap< EnumType >::lookUpString(), t, Chroma::QPhiXSolverTypeEnv::typeIDString, and Chroma::write().
|
private |
Definition at line 34 of file enum_type_map.h.
Referenced by Chroma::EnumTypeMap< EnumType >::dumpMapStrings(), Chroma::EnumTypeMap< EnumType >::lookUpString(), and Chroma::EnumTypeMap< EnumType >::registerPair().
|
private |
Definition at line 35 of file enum_type_map.h.
Referenced by Chroma::EnumTypeMap< EnumType >::lookUpEnum(), and Chroma::EnumTypeMap< EnumType >::registerPair().