ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
|
Variable-type value object a.k.a. a poor mans std::variant. More...
#include <acts/blob/master/thirdparty/dfelibs/dfe/dfe_dispatcher.hpp>
Classes | |
struct | Converter< bool > |
struct | Converter< double > |
struct | Converter< float > |
struct | Converter< int16_t > |
struct | Converter< int32_t > |
struct | Converter< int64_t > |
struct | Converter< int8_t > |
struct | Converter< std::string > |
struct | Converter< uint16_t > |
struct | Converter< uint32_t > |
struct | Converter< uint64_t > |
struct | Converter< uint8_t > |
struct | IntegerConverter |
Public Types | |
enum | Type |
Supported value types. More... | |
Public Member Functions | |
Variable () | |
Variable (Variable &&v) | |
Variable (const Variable &v) | |
Variable (std::string &&s) | |
Variable (const std::string &s) | |
Variable (const char *s) | |
template<typename I , typename = std::enable_if_t<std::is_integral<I>::value>> | |
Variable (I integer) | |
Variable (double d) | |
Variable (float f) | |
Variable (bool b) | |
~Variable ()=default | |
Variable & | operator= (Variable &&v) |
Variable & | operator= (const Variable &v) |
constexpr bool | operator! () const |
constexpr | operator bool () const |
constexpr Type | type () const |
The type of the currently stored value. | |
template<typename T > | |
auto | as () const |
Static Public Member Functions | |
static Variable | parse_as (const std::string &str, Type type) |
Parse a string into a value of the requested type. | |
Private Attributes | |
union { | |
int64_t m_integer | |
double m_float | |
bool m_boolean | |
}; | |
std::string | m_string |
Type | m_type |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Variable &v) |
Variable-type value object a.k.a. a poor mans std::variant.
Definition at line 43 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 43 of file dfe_dispatcher.hpp
enum dfe::Variable::Type |
Supported value types.
Definition at line 46 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 46 of file dfe_dispatcher.hpp
|
inline |
Definition at line 48 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 48 of file dfe_dispatcher.hpp
Referenced by parse_as().
|
inline |
Definition at line 49 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 49 of file dfe_dispatcher.hpp
References v.
|
inline |
Definition at line 50 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 50 of file dfe_dispatcher.hpp
References v.
|
inlineexplicit |
Definition at line 51 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 51 of file dfe_dispatcher.hpp
|
inlineexplicit |
Definition at line 53 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 53 of file dfe_dispatcher.hpp
|
inlineexplicit |
Definition at line 54 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 54 of file dfe_dispatcher.hpp
|
inlineexplicit |
Definition at line 57 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 57 of file dfe_dispatcher.hpp
|
inlineexplicit |
Definition at line 59 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 59 of file dfe_dispatcher.hpp
|
inlineexplicit |
Definition at line 60 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 60 of file dfe_dispatcher.hpp
|
inlineexplicit |
Definition at line 61 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 61 of file dfe_dispatcher.hpp
|
default |
|
inline |
Get value of the variable as a specific type.
std::invalid_argument | if the requested type is incompatible |
Definition at line 274 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 274 of file dfe_dispatcher.hpp
References m_type.
Referenced by parton(), pycjdc(), pyglui(), pygrvd(), pygrvl(), pygrvm(), pyhisigh(), pyhiwidt(), pymrun(), pynjdc(), pyrnmq(), pysfdc(), pysgex(), pysghf(), pysghg(), pysgqc(), pysgsu(), pysgtc(), pysgwz(), pysigh(), pystbh(), pywidt(), pywidx(), and pyxued().
|
inlineexplicit |
Definition at line 75 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 75 of file dfe_dispatcher.hpp
|
inline |
In a boolean context a variable is false if it does not contain a value.
Definition at line 73 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 73 of file dfe_dispatcher.hpp
References m_type.
Definition at line 191 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 191 of file dfe_dispatcher.hpp
References m_boolean, m_float, m_integer, m_string, m_type, and v.
Definition at line 210 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 210 of file dfe_dispatcher.hpp
References m_boolean, m_float, m_integer, m_string, and m_type.
Parse a string into a value of the requested type.
Definition at line 162 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 162 of file dfe_dispatcher.hpp
References Variable().
|
inline |
The type of the currently stored value.
Definition at line 77 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 77 of file dfe_dispatcher.hpp
References m_type.
Referenced by dfe::operator<<().
|
friend |
Definition at line 177 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 177 of file dfe_dispatcher.hpp
union { ... } |
bool dfe::Variable::m_boolean |
Definition at line 93 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 93 of file dfe_dispatcher.hpp
Referenced by dfe::Variable::Converter< bool >::as_t(), dfe::operator<<(), and operator=().
double dfe::Variable::m_float |
Definition at line 92 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 92 of file dfe_dispatcher.hpp
Referenced by dfe::Variable::Converter< float >::as_t(), dfe::Variable::Converter< double >::as_t(), dfe::operator<<(), and operator=().
int64_t dfe::Variable::m_integer |
Definition at line 91 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 91 of file dfe_dispatcher.hpp
Referenced by dfe::Variable::IntegerConverter< uint64_t >::as_t(), dfe::operator<<(), and operator=().
|
private |
Definition at line 97 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 97 of file dfe_dispatcher.hpp
Referenced by dfe::Variable::Converter< std::string >::as_t(), dfe::operator<<(), and operator=().
|
private |
Definition at line 98 of file dfe_dispatcher.hpp.
View newest version in sPHENIX GitHub at line 98 of file dfe_dispatcher.hpp
Referenced by as(), operator!(), dfe::operator<<(), operator=(), and type().