11 #ifndef NO_C_ARRAY_AS_PROPERTY_WARNING 12 # warning deprecated header (will be removed in Gaudi v29r0), think about using std::array<T,N> instead of T[N] 14 #ifndef GAUDIKERNEL_CARRAYASPROPERTY_H 15 # define GAUDIKERNEL_CARRAYASPROPERTY_H 19 template <
class TYPE,
size_t N,
class VERIFIER,
class HANDLERS>
37 static inline constexpr
bool is_this_type_v = std::is_same_v<Property, typename std::remove_reference_t<T>>;
49 using PropertyBase::declareReadHandler;
50 using PropertyBase::declareUpdateHandler;
88 for (
size_t i = 0; i !=
N; ++i ) {
m_value[i] = v[i]; }
120 inline size_t size()
const {
return N; }
121 inline bool empty()
const {
return false; }
122 template <
class T = const ValueType>
123 inline decltype( std::declval<T>()[
typename T::key_type{}] )
operator[](
const typename T::key_type& key )
const {
126 template <
class T = ValueType>
127 inline decltype( std::declval<T>()[
typename T::key_type{}] )
operator[](
const typename T::key_type& key ) {
136 const Property* p = dynamic_cast<const Property*>( &source );
140 this->
fromString( source.toString() ).ignore();
147 return dest.assign( *
this );
170 template <
class TYPE,
size_t N,
class VERIFIER,
class HANDLERS>
const ValueType & value() const
Backward compatibility.
StatusCode fromString(const std::string &source) override
string -> value
std::string toString() const override
value -> string
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
static constexpr bool is_this_type_v
helper typedefs for SFINAE
bool useUpdateHandler() override
manual trigger for callback for update
Implementation of property with value of concrete type.
void toStream(std::ostream &out) const override
value -> stream
StorageType m_value
Storage.
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
constexpr static const auto SUCCESS
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.
const std::function< void(PropertyBase &)> readCallBack() const override
get a reference to the readCallBack
const std::function< void(PropertyBase &)> updateCallBack() const override
get a reference to the updateCallBack
const std::string name() const
property name
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.
PropertyBase(const std::type_info &type, std::string name="", std::string doc="", std::string semantics="")
constructor from the property name and the type
This class is used for returning status codes from appropriate routines.
const ValueType & value() const
Backward compatibility (.
bool set(const ValueType &v)
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
const VerifierType & verifier() const
Copy constructor.
PropertyBase * clone() const override
clones the current property
std::string type() const
property type
bool assign(const PropertyBase &source) override
get the value from another property
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
bool load(PropertyBase &dest) const override
set value to another property
Property & operator=(const ValueType &v)
Assignment from value.
Header file for std:chrono::duration-based Counters.
VerifierType & verifier()
Accessor to verifier.
StatusCode fromString(const std::string &source) override
string -> value