13 #ifndef DD4HEP_DDG4_COMPONENTPROPERTIES_INL_H
14 #define DD4HEP_DDG4_COMPONENTPROPERTIES_INL_H
41 if (g.
type() ==
typeid(TYPE))
43 else if (!g.
fromString(
m_par, BasicGrammar::instance< TYPE >().str(&val)))
56 if (g.
type() ==
typeid(TYPE))
58 else if (!BasicGrammar::instance< TYPE >().fromString(&val, this->
str()))
72 #define DD4HEP_DEFINE_PROPERTY_TYPE(x) \
73 template x Property::value() const; \
74 template void Property::value(x& value) const; \
75 template void Property::set(const x& value); \
76 template Property& Property::operator=(const x& value); \
77 template void Property::make(x& value)
80 #define DD4HEP_DEFINE_PROPERTY_CONT(x) \
81 DD4HEP_DEFINE_PROPERTY_TYPE(x); \
82 DD4HEP_DEFINE_PROPERTY_TYPE(std::vector<x>); \
83 DD4HEP_DEFINE_PROPERTY_TYPE(std::list<x>); \
84 DD4HEP_DEFINE_PROPERTY_TYPE(std::set<x>)
86 #if defined(DD4HEP_HAVE_ALL_PARSERS)
91 #define DD4HEP_DEFINE_PROPERTY_U_CONT(x) \
92 DD4HEP_DEFINE_PROPERTY_CONT(x); \
93 DD4HEP_DEFINE_PROPERTY_CONT(unsigned x)
97 #define DD4HEP_DEFINE_PROPERTY_U_CONT(x) DD4HEP_DEFINE_PROPERTY_CONT(x)
99 #endif // DD4HEP_HAVE_ALL_PARSERS
100 #endif // DD4HEP_DDG4_COMPONENTPROPERTIES_INL_H
void make(TYPE &value)
Setup property.
virtual const std::type_info & type() const
Access to the type information.
The property class to assign options to actions.
virtual bool fromString(void *ptr, const std::string &value) const
Set value from serialized string. On successful data conversion TRUE is returned. ...
Class describing the grammar representation of a given data type.
std::string str() const
Conversion to string value.
static void invalidConversion(const std::type_info &from, const std::type_info &to)
Error callback on invalid conversion.
const PropertyGrammar * m_hdl
Reference to the grammar of this property (extended type description)
Property & operator=(const Property &p)=default
Assignment operator.
const PropertyGrammar & grammar() const
Access grammar object.
TYPE value() const
Retrieve value.
void * m_par
Pointer to the data location.
void set(const TYPE &value)
Set value of this property.