1 #ifndef NO_C_ARRAY_AS_PROPERTY_WARNING 2 #warning deprecated header (will be removed in Gaudi v29r0), think about using std::array<T,N> instead of T[N] 4 #ifndef GAUDIKERNEL_CARRAYASPROPERTY_H 5 #define GAUDIKERNEL_CARRAYASPROPERTY_H 10 template <
class TYPE,
size_t N,
class VERIFIER,
class HANDLERS>
42 using PropertyBase::declareReadHandler;
43 using PropertyBase::declareUpdateHandler;
66 m_handlers.useUpdateHandler( *
this );
73 m_handlers.useReadHandler( *
this );
86 for (
size_t i = 0; i !=
N; ++i ) {
89 m_handlers.useUpdateHandler( *
this );
122 inline size_t size()
const {
return N; }
123 inline bool empty()
const {
return false; }
124 template <
class T = const ValueType>
125 inline decltype( std::declval<T>()[
typename T::key_type{}] )
operator[](
const typename T::key_type& key )
const 129 template <
class T = ValueType>
130 inline decltype( std::declval<T>()[
typename T::key_type{}] )
operator[](
const typename T::key_type& key )
145 this->
fromString( source.toString() ).ignore();
153 return dest.assign( *
this );
169 m_handlers.useReadHandler( *
this );
175 m_handlers.useReadHandler( *
this );
179 template <
class TYPE,
size_t N,
class VERIFIER,
class HANDLERS>
StatusCode fromString(const std::string &source) override
string -> value
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
bool useUpdateHandler() override
manual trigger for callback for update
Implementation of property with value of concrete type.
const std::string name() const
property name
StorageType m_value
Storage.
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
StorageType m_value
Storage.
typename std::remove_reference< StorageType >::type ValueType
TYPE(&)[N] StorageType
Hosted type.
PropertyBase & declareUpdateHandler(std::function< void(PropertyBase &)> fun) override
set new callback for update
Property()
Construct an anonymous property with default constructed value.
const ValueType & value() const
Backward compatibility.
This class is used for returning status codes from appropriate routines.
bool load(PropertyBase &dest) const override
set value to another property
const std::function< void(PropertyBase &)> readCallBack() const override
get a reference to the readCallBack
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
constexpr static const auto SUCCESS
const VerifierType & verifier() const
Copy constructor.
bool assign(const PropertyBase &source) override
get the value from another property
double fun(const std::vector< double > &x)
std::string type() const
property type
Property(std::string name, StorageType value, std::string doc="")
the constructor with property name, value and documentation.
bool setValue(const ValueType &v)
PropertyBase & declareReadHandler(std::function< void(PropertyBase &)> fun) override
set new callback for reading
const ValueType & value() const
Backward compatibility (.
void toStream(std::ostream &out) const override
value -> stream
PropertyBase * clone() const override
clones the current property
std::string toString() const override
value -> string
const std::function< void(PropertyBase &)> updateCallBack() const override
get a reference to the updateCallBack
Property & operator=(const ValueType &v)
Assignment from value.
Helper functions to set/get the application return code.
VerifierType & verifier()
Accessor to verifier.
StatusCode fromString(const std::string &source) override
string -> value