Go to the documentation of this file.
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 ) {
147 return dest.assign( *
this );
170 template <
class TYPE,
size_t N,
class VERIFIER,
class HANDLERS>
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
const std::string name() const
property name
PropertyBase & declareReadHandler(std::function< void(PropertyBase &)> fun) override
set new callback for reading
std::string type() const
property type
StatusCode fromString(const std::string &source) override
string -> value
const std::function< void(PropertyBase &)> readCallBack() const override
get a reference to the readCallBack
TYPE(&)[N] StorageType
Hosted type.
Property & operator=(const ValueType &v)
Assignment from value.
StatusCode fromString(const std::string &source) override
string -> value
std::string toString() const override
value -> string
Property(std::string name, StorageType value, std::string doc="")
the constructor with property name, value and documentation.
PropertyBase * clone() const override
clones the current property
PropertyBase & declareUpdateHandler(std::function< void(PropertyBase &)> fun) override
set new callback for update
const ValueType & value() const
Backward compatibility (.
void toStream(std::ostream &out) const override
value -> stream
bool assign(const PropertyBase &source) override
get the value from another property
PropertyBase(const std::type_info &type, std::string name="", std::string doc="", std::string semantics="")
constructor from the property name and the type
bool setValue(const ValueType &v)
bool set(const ValueType &v)
typename std::remove_reference< StorageType >::type ValueType
Header file for std:chrono::duration-based Counters.
const ValueType & value() const
Backward compatibility.
const std::function< void(PropertyBase &)> updateCallBack() const override
get a reference to the updateCallBack
const VerifierType & verifier() const
Copy constructor.
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
constexpr static const auto SUCCESS
StorageType m_value
Storage.
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
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
static constexpr bool is_this_type_v
helper typedefs for SFINAE
bool useUpdateHandler() override
manual trigger for callback for update
bool load(PropertyBase &dest) const override
set value to another property
VerifierType & verifier()
Accessor to verifier.
StorageType m_value
Storage.
Implementation of property with value of concrete type.
Property()
Construct an anonymous property with default constructed value.