#include "AmpGen/MsgService.h"
#include "AmpGen/Utilities.h"
#include <string.h>
Go to the source code of this file.
◆ complete_enum
#define complete_enum |
( |
| name, |
|
|
| ... ) |
Value:template <> name parse(
const std::string& word){
constexpr auto args = #__VA_ARGS__;
return AmpGen::detail::parse<name>(word, args); } \
template <> std::string to_string(
const name& enumItem ){
constexpr auto args = #__VA_ARGS__;
return AmpGen::detail::to_string<name>(enumItem, args) ; } \
template <> name
lexical_cast(
const std::string& word,
bool& ){
return parse<name>(word); } \
std::ostream&
operator<<(std::ostream& os,
const name& np){
return os << to_string<name>(np);}
T parse(const std::string &word, const char *args)
std::string to_string(const T &enumItem, const char *args)
std::ostream & operator<<(std::ostream &os, const CompiledExpressionBase &expression)
return_type lexical_cast(const std::string &word, bool &status)
Definition at line 13 of file enum.h.
◆ declare_enum
#define declare_enum |
( |
| name, |
|
|
| ... ) |
Value:enum class name {__VA_ARGS__, Invalid}; \
template <> name parse(const std::string& word); \
template <> std::string to_string( const name& enumItem ); \
std::ostream& operator<<( std::ostream& os, const name& np);
Definition at line 7 of file enum.h.
◆ make_enum
#define make_enum |
( |
| name, |
|
|
| ... ) |
Value:enum class name {__VA_ARGS__, Invalid}; \
template <> name parse(
const std::string& word){
constexpr auto args = #__VA_ARGS__;
return AmpGen::detail::parse<name>(word, args); } \
template <> name
lexical_cast(
const std::string& word,
bool& ){
return parse<name>(word); } \
std::ostream&
operator<<(std::ostream& os,
const name& np){
return os << to_string<name>(np);}
std::string to_string(const T &enumItem)
Definition at line 19 of file enum.h.