The Gaudi Framework  master (adcf1ca6)
Loading...
Searching...
No Matches
Gaudi::Property< TYPE, VERIFIER, HANDLERS > Class Template Reference

Implementation of property with value of concrete type. More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Property.h>

Inheritance diagram for Gaudi::Property< TYPE, VERIFIER, HANDLERS >:
Collaboration diagram for Gaudi::Property< TYPE, VERIFIER, HANDLERS >:

Public Types

using StorageType = TYPE
 Hosted type.
 
using ValueType = typename std::remove_reference<StorageType>::type
 
using VerifierType = VERIFIER
 
using HandlersType = HANDLERS
 

Public Member Functions

template<typename T = StorageType>
 Property (std::string name, T &&value, std::string doc="", std::string semantics="")
 the constructor with property name, value and documentation.
 
template<std::derived_from< IProperty > OWNER, typename T = ValueType>
requires ( std::is_default_constructible_v<T> )
 Property (OWNER *owner, std::string name)
 Autodeclaring constructor with property name, value and documentation.
 
template<std::derived_from< IProperty > OWNER, typename T = StorageType>
 Property (OWNER *owner, std::string name, T &&value, std::string doc="", std::string semantics="")
 Autodeclaring constructor with property name, value and documentation.
 
template<std::derived_from< IProperty > OWNER, typename T = StorageType>
 Property (OWNER *owner, std::string name, T &&value, std::function< void(PropertyBase &)> handler, std::string doc="", std::string semantics="")
 Autodeclaring constructor with property name, value, updateHandler and documentation.
 
template<std::derived_from< IProperty > OWNER, typename T = StorageType>
 Property (OWNER *owner, std::string name, T &&value, void(OWNER::*handler)(PropertyBase &), std::string doc="", std::string semantics="")
 Autodeclaring constructor with property name, value, pointer to member function updateHandler and documentation.
 
template<std::derived_from< IProperty > OWNER, typename T = StorageType>
 Property (OWNER *owner, std::string name, T &&value, void(OWNER::*handler)(), std::string doc="", std::string semantics="")
 Autodeclaring constructor with property name, value, pointer to member function updateHandler and documentation.
 
template<std::derived_from< IProperty > OWNER, typename T = StorageType>
 Property (OWNER *owner, std::string name, T &&value, std::function< void(PropertyBase &)> handler, Details::Property::ImmediatelyInvokeHandler invoke, std::string doc="", std::string semantics="")
 Autodeclaring constructor with property name, value, updateHandler and documentation.
 
template<typename T>
requires ( !std::is_same_v<Property, std::remove_reference_t<T>> )
 Property (T &&v)
 Construct an anonymous property from a value.
 
template<typename T = StorageType>
requires ( !std::is_reference_v<T> )
 Property ()
 Construct an anonymous property with default constructed value.
 
Details::PropertyBasedeclareReadHandler (std::function< void(Details::PropertyBase &)> fun) override
 set new callback for reading
 
Details::PropertyBasedeclareUpdateHandler (std::function< void(Details::PropertyBase &)> fun) override
 set new callback for update
 
const std::function< void(Details::PropertyBase &)> readCallBack () const override
 get a reference to the readCallBack
 
const std::function< void(Details::PropertyBase &)> updateCallBack () const override
 get a reference to the updateCallBack
 
bool useUpdateHandler () override
 manual trigger for callback for update
 
 operator const ValueType & () const
 Automatic conversion to value (const reference).
 
 operator std::string_view () const
 
std::ostream & fillStream (std::ostream &stream) const override
 Properly quote string properties when printing them.
 
 operator std::string_view () const
 
template<typename T>
requires requires { { m_value == other } -> std::convertible_to<bool>; }
bool operator== (const T &other) const
 equality comparison
 
template<typename T>
requires requires { { m_value != other } -> std::convertible_to<bool>; }
bool operator!= (const T &other) const
 inequality comparison
 
template<typename T>
requires requires { { m_value < other } -> std::convertible_to<bool>; }
bool operator< (const T &other) const
 "less" comparison
 
template<typename T>
requires requires { m_value + other; }
auto operator+ (const T &other) const
 allow addition if possible between the property and the other types
 
template<typename T>
requires ( std::assignable_from<TYPE&, T &&> || std::constructible_from<TYPE, T &&> )
Propertyoperator= (T &&v)
 Assignment from value.
 
template<typename T = TYPE>
requires requires { typename T::value_type; } && std::constructible_from<TYPE, std::initializer_list<typename T::value_type>>
Propertyoperator= (std::initializer_list< typename T::value_type > ilist)
 
const VerifierTypeverifier () const
 Accessor to verifier.
 
VerifierTypeverifier ()
 Accessor to verifier.
 
template<typename... Args>
requires std::invocable<ValueType&, Args...>
constexpr decltype(auto) operator() (Args &&... args) const noexcept(std::is_nothrow_invocable_v< ValueType &, Args... >)
 
bool assign (const Details::PropertyBase &source) override
 get the value from another property
 
bool load (Details::PropertyBase &dest) const override
 set value to another property
 
StatusCode fromString (const std::string &source) override
 string -> value
 
std::string toString () const override
 value -> string
 
void toStream (std::ostream &out) const override
 value -> stream
 
virtual PropertyBasedeclareReadHandler (std::function< void(PropertyBase &)> fun)=0
 set new callback for reading
 
template<class HT>
PropertyBasedeclareReadHandler (void(HT::*MF)(PropertyBase &), HT *instance)
 
virtual PropertyBasedeclareUpdateHandler (std::function< void(PropertyBase &)> fun)=0
 set new callback for update
 
template<class HT>
PropertyBasedeclareUpdateHandler (void(HT::*MF)(PropertyBase &), HT *instance)
 
const ValueTypevalue () const
 
ValueTypevalue ()
 
bool setValue (const ValueType &v)
 
bool set (const ValueType &v)
 
Details::PropertyBaseclone () const override
 clones the current property
 
Helpers for easy use of string and vector properties.

They are instantiated only if they are implemented in the wrapped class.

auto size () const
 
auto length () const
 
auto empty () const
 
void clear ()
 
auto begin () const
 
auto end () const
 
auto begin ()
 
auto end ()
 
template<typename ARG>
requires requires { value()[arg]; }
decltype(auto) operator[] (const ARG &arg) const
 
template<typename ARG>
requires requires { value()[arg]; }
decltype(auto) operator[] (const ARG &arg)
 
template<typename K>
requires requires { value().find( key ); }
decltype(auto) find (const K &key) const
 
template<typename K>
requires requires { value().find( key ); }
decltype(auto) find (const K &key)
 
template<typename T>
requires requires { value().erase( arg ); }
decltype(auto) erase (T arg)
 
Propertyoperator++ ()
 
auto operator++ (int)
 
Propertyoperator-- ()
 
auto operator-- (int)
 
template<typename T>
requires requires { m_value += other; }
Propertyoperator+= (const T &other)
 
template<typename T>
requires requires { m_value -= other; }
Propertyoperator-= (const T &other)
 
decltype(auto) key () const
 Helpers for DataHandles and derived classes.
 
decltype(auto) objKey () const
 
decltype(auto) fullKey () const
 
decltype(auto) initialize ()
 
decltype(auto) makeHandles () const
 
template<typename ARG>
requires requires { value().makeHandles( arg ); }
decltype(auto) makeHandles (const ARG &arg) const
 
- Public Member Functions inherited from Gaudi::Details::PropertyBase
const std::string name () const
 property name
 
std::string documentation () const
 property documentation
 
std::string semantics () const
 property semantics
 
const std::type_info * type_info () const
 property type-info
 
std::string type () const
 property type
 
template<class HT>
PropertyBasedeclareReadHandler (void(HT::*MF)(PropertyBase &), HT *instance)
 
template<class HT>
PropertyBasedeclareUpdateHandler (void(HT::*MF)(PropertyBase &), HT *instance)
 
virtual ~PropertyBase ()
 virtual destructor
 
void setName (std::string value)
 set the new value for the property name
 
void setDocumentation (std::string value)
 set the documentation string
 
void setSemantics (std::string value)
 set the semantics string
 
void setOwnerType (const std::type_info &ownerType)
 set the type of the owner class (used for documentation)
 
template<class OWNER>
void setOwnerType ()
 set the type of the owner class (used for documentation)
 
const std::type_info * ownerType () const
 get the type of the owner class (used for documentation)
 
std::string ownerTypeName () const
 get the string for the type of the owner class (used for documentation)
 

Private Attributes

StorageType m_value
 
VerifierType m_verifier
 
HandlersType m_handlers
 

Additional Inherited Members

- Protected Member Functions inherited from Gaudi::Details::PropertyBase
 PropertyBase (const std::type_info &type, std::string name="", std::string doc="", std::string semantics="")
 constructor from the property name and the type
 
 PropertyBase (std::string name, const std::type_info &type)
 constructor from the property name and the type
 
 PropertyBase (const PropertyBase &)=default
 copy constructor
 
PropertyBaseoperator= (const PropertyBase &)=default
 assignment operator
 

Detailed Description

template<class TYPE, class VERIFIER, class HANDLERS>
class Gaudi::Property< TYPE, VERIFIER, HANDLERS >

Implementation of property with value of concrete type.

Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-02-27
Author
Marco Clemencic
Date
2016-06-16

Definition at line 27 of file PropertyFwd.h.

Member Typedef Documentation

◆ HandlersType

template<class TYPE, class VERIFIER, class HANDLERS>
using Gaudi::Property< TYPE, VERIFIER, HANDLERS >::HandlersType = HANDLERS

Definition at line 41 of file Property.h.

◆ StorageType

template<class TYPE, class VERIFIER, class HANDLERS>
using Gaudi::Property< TYPE, VERIFIER, HANDLERS >::StorageType = TYPE

Hosted type.

Definition at line 38 of file Property.h.

◆ ValueType

template<class TYPE, class VERIFIER, class HANDLERS>
using Gaudi::Property< TYPE, VERIFIER, HANDLERS >::ValueType = typename std::remove_reference<StorageType>::type

Definition at line 39 of file Property.h.

◆ VerifierType

template<class TYPE, class VERIFIER, class HANDLERS>
using Gaudi::Property< TYPE, VERIFIER, HANDLERS >::VerifierType = VERIFIER

Definition at line 40 of file Property.h.

Constructor & Destructor Documentation

◆ Property() [1/9]

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename T = StorageType>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( std::string name,
T && value,
std::string doc = "",
std::string semantics = "" )
inline

the constructor with property name, value and documentation.

Definition at line 51 of file Property.h.

55 }
std::string semantics() const
property semantics
const std::string name() const
property name
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
StorageType m_value
Definition Property.h:44
const ValueType & value() const
Definition Property.h:251
VerifierType m_verifier
Definition Property.h:45
typename std::remove_reference< StorageType >::type ValueType
Definition Property.h:39

◆ Property() [2/9]

template<class TYPE, class VERIFIER, class HANDLERS>
template<std::derived_from< IProperty > OWNER, typename T = ValueType>
requires ( std::is_default_constructible_v<T> )
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER * owner,
std::string name )
inline

Autodeclaring constructor with property name, value and documentation.

Note
the use of requires is required to avoid ambiguities

Definition at line 60 of file Property.h.

60 : Property( std::move( name ), ValueType{}, "" ) {
61 owner->declareProperty( *this );
63 }
void setOwnerType()
set the type of the owner class (used for documentation)
Property()
Construct an anonymous property with default constructed value.
Definition Property.h:124

◆ Property() [3/9]

template<class TYPE, class VERIFIER, class HANDLERS>
template<std::derived_from< IProperty > OWNER, typename T = StorageType>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER * owner,
std::string name,
T && value,
std::string doc = "",
std::string semantics = "" )
inline

Autodeclaring constructor with property name, value and documentation.

Note
the use of requires is required to avoid ambiguities

Definition at line 68 of file Property.h.

70 owner->declareProperty( *this );
72 }

◆ Property() [4/9]

template<class TYPE, class VERIFIER, class HANDLERS>
template<std::derived_from< IProperty > OWNER, typename T = StorageType>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER * owner,
std::string name,
T && value,
std::function< void(PropertyBase &)> handler,
std::string doc = "",
std::string semantics = "" )
inline

Autodeclaring constructor with property name, value, updateHandler and documentation.

Note
the use of requires is required to avoid ambiguities

Definition at line 77 of file Property.h.

81 }
Details::PropertyBase & declareUpdateHandler(std::function< void(Details::PropertyBase &)> fun) override
set new callback for update
Definition Property.h:135

◆ Property() [5/9]

template<class TYPE, class VERIFIER, class HANDLERS>
template<std::derived_from< IProperty > OWNER, typename T = StorageType>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER * owner,
std::string name,
T && value,
void(OWNER::* handler )(PropertyBase &),
std::string doc = "",
std::string semantics = "" )
inline

Autodeclaring constructor with property name, value, pointer to member function updateHandler and documentation.

Note
the use of requires is required to avoid ambiguities

Definition at line 86 of file Property.h.

88 : Property(
90 [owner, handler]( PropertyBase& p ) { ( owner->*handler )( p ); }, std::move( doc ),
91 std::move( semantics ) ) {}
PropertyBase(const std::type_info &type, std::string name="", std::string doc="", std::string semantics="")
constructor from the property name and the type

◆ Property() [6/9]

template<class TYPE, class VERIFIER, class HANDLERS>
template<std::derived_from< IProperty > OWNER, typename T = StorageType>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER * owner,
std::string name,
T && value,
void(OWNER::* handler )(),
std::string doc = "",
std::string semantics = "" )
inline

Autodeclaring constructor with property name, value, pointer to member function updateHandler and documentation.

Note
the use of requires is required to avoid ambiguities

Definition at line 95 of file Property.h.

97 : Property(
99 [owner, handler]( PropertyBase& ) { ( owner->*handler )(); }, std::move( doc ), std::move( semantics ) ) {
100 }

◆ Property() [7/9]

template<class TYPE, class VERIFIER, class HANDLERS>
template<std::derived_from< IProperty > OWNER, typename T = StorageType>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( OWNER * owner,
std::string name,
T && value,
std::function< void(PropertyBase &)> handler,
Details::Property< TYPE, VERIFIER, HANDLERS >::ImmediatelyInvokeHandler invoke,
std::string doc = "",
std::string semantics = "" )
inline

Autodeclaring constructor with property name, value, updateHandler and documentation.

Note
the use of requires is required to avoid ambiguities

Definition at line 105 of file Property.h.

108 std::move( semantics ) ) {
109 if ( invoke ) useUpdateHandler();
110 }
bool useUpdateHandler() override
manual trigger for callback for update
Definition Property.h:150

◆ Property() [8/9]

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename T>
requires ( !std::is_same_v<Property, std::remove_reference_t<T>> )
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( T && v)
inline

Construct an anonymous property from a value.

This constructor is not generated if T is the current type, so that the compiler picks up the copy constructor instead of this one.

Definition at line 117 of file Property.h.

118 : Details::PropertyBase( typeid( ValueType ), "", "", "" ), m_value( std::forward<T>( v ) ) {}

◆ Property() [9/9]

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename T = StorageType>
requires ( !std::is_reference_v<T> )
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::Property ( )
inline

Construct an anonymous property with default constructed value.

Can be used only if StorageType is default constructible.

Definition at line 124 of file Property.h.

124: Details::PropertyBase( typeid( ValueType ), "", "", "" ), m_value() {}

Member Function Documentation

◆ assign()

template<class TYPE, class VERIFIER, class HANDLERS>
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::assign ( const Details::PropertyBase & source)
inlineoverridevirtual

get the value from another property

Implements Gaudi::Details::PropertyBase.

Definition at line 417 of file Property.h.

417 {
418 // Check if the property is of "the same" type, except for strings
419 const Property* p =
421 if ( p ) {
422 *this = p->value();
423 } else {
424 return this->fromString( source.toString() ).isSuccess();
425 }
426 return true;
427 }
Property(std::string name, T &&value, std::string doc="", std::string semantics="")
the constructor with property name, value and documentation.
Definition Property.h:51
std::string toString() const override
value -> string
Definition Property.h:462
StatusCode fromString(const std::string &source) override
string -> value
Definition Property.h:434
bool isSuccess() const
Definition StatusCode.h:314

◆ begin() [1/2]

template<class TYPE, class VERIFIER, class HANDLERS>
auto Gaudi::Property< TYPE, VERIFIER, HANDLERS >::begin ( )
inline

Definition at line 297 of file Property.h.

298 { value().begin(); }
299 {
300 return value().begin();
301 }

◆ begin() [2/2]

template<class TYPE, class VERIFIER, class HANDLERS>
auto Gaudi::Property< TYPE, VERIFIER, HANDLERS >::begin ( ) const
inline

Definition at line 287 of file Property.h.

288 { value().begin(); }
289 {
290 return value().begin();
291 }

◆ clear()

template<class TYPE, class VERIFIER, class HANDLERS>
void Gaudi::Property< TYPE, VERIFIER, HANDLERS >::clear ( )
inline

Definition at line 282 of file Property.h.

283 { value().clear(); }
284 {
285 value().clear();
286 }

◆ clone()

template<class TYPE, class VERIFIER, class HANDLERS>
Details::PropertyBase * Gaudi::Property< TYPE, VERIFIER, HANDLERS >::clone ( ) const
inlineoverridevirtual

clones the current property

Implements Gaudi::Details::PropertyBase.

Definition at line 261 of file Property.h.

261{ return new Property( *this ); }

◆ declareReadHandler() [1/3]

template<class TYPE, class VERIFIER, class HANDLERS>
Details::PropertyBase & Gaudi::Property< TYPE, VERIFIER, HANDLERS >::declareReadHandler ( std::function< void(Details::PropertyBase &)> fun)
inlineoverride

set new callback for reading

Definition at line 130 of file Property.h.

130 {
131 m_handlers.setReadHandler( std::move( fun ) );
132 return *this;
133 }
HandlersType m_handlers
Definition Property.h:46

◆ declareReadHandler() [2/3]

template<class TYPE, class VERIFIER, class HANDLERS>
virtual PropertyBase & Gaudi::Details::PropertyBase::declareReadHandler ( std::function< void(PropertyBase &)> fun)
virtual

set new callback for reading

Implements Gaudi::Details::PropertyBase.

◆ declareReadHandler() [3/3]

template<class TYPE, class VERIFIER, class HANDLERS>
template<class HT>
PropertyBase & Gaudi::Details::PropertyBase::declareReadHandler ( void(HT::* MF )(PropertyBase &),
HT * instance )
inline

Definition at line 75 of file PropertyBase.h.

75 {
76 return declareReadHandler( [=]( PropertyBase& p ) { ( instance->*MF )( p ); } );
77 }
Details::PropertyBase & declareReadHandler(std::function< void(Details::PropertyBase &)> fun) override
set new callback for reading
Definition Property.h:130

◆ declareUpdateHandler() [1/3]

template<class TYPE, class VERIFIER, class HANDLERS>
Details::PropertyBase & Gaudi::Property< TYPE, VERIFIER, HANDLERS >::declareUpdateHandler ( std::function< void(Details::PropertyBase &)> fun)
inlineoverride

set new callback for update

Definition at line 135 of file Property.h.

135 {
136 m_handlers.setUpdateHandler( std::move( fun ) );
137 return *this;
138 }

◆ declareUpdateHandler() [2/3]

template<class TYPE, class VERIFIER, class HANDLERS>
virtual PropertyBase & Gaudi::Details::PropertyBase::declareUpdateHandler ( std::function< void(PropertyBase &)> fun)
virtual

set new callback for update

Implements Gaudi::Details::PropertyBase.

◆ declareUpdateHandler() [3/3]

template<class TYPE, class VERIFIER, class HANDLERS>
template<class HT>
PropertyBase & Gaudi::Details::PropertyBase::declareUpdateHandler ( void(HT::* MF )(PropertyBase &),
HT * instance )
inline

Definition at line 80 of file PropertyBase.h.

80 {
81 return declareUpdateHandler( [=]( PropertyBase& p ) { ( instance->*MF )( p ); } );
82 }

◆ empty()

template<class TYPE, class VERIFIER, class HANDLERS>
auto Gaudi::Property< TYPE, VERIFIER, HANDLERS >::empty ( ) const
inline

Definition at line 277 of file Property.h.

278 { value().empty(); }
279 {
280 return value().empty();
281 }

◆ end() [1/2]

template<class TYPE, class VERIFIER, class HANDLERS>
auto Gaudi::Property< TYPE, VERIFIER, HANDLERS >::end ( )
inline

Definition at line 302 of file Property.h.

303 { value().end(); }
304 {
305 return value().end();
306 }

◆ end() [2/2]

template<class TYPE, class VERIFIER, class HANDLERS>
auto Gaudi::Property< TYPE, VERIFIER, HANDLERS >::end ( ) const
inline

Definition at line 292 of file Property.h.

293 { value().end(); }
294 {
295 return value().end();
296 }

◆ erase()

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename T>
requires requires { value().erase( arg ); }
decltype(auto) Gaudi::Property< TYPE, VERIFIER, HANDLERS >::erase ( T arg)
inline

Definition at line 332 of file Property.h.

333 { value().erase( arg ); }
334 {
335 return value().erase( arg );
336 }

◆ fillStream()

template<class TYPE, class VERIFIER, class HANDLERS>
std::ostream & Gaudi::Property< TYPE, VERIFIER, HANDLERS >::fillStream ( std::ostream & stream) const
inlineoverridevirtual

Properly quote string properties when printing them.

Reimplemented from Gaudi::Details::PropertyBase.

Definition at line 174 of file Property.h.

174 {
175 stream << " '" << name() << "':";
178 toStream( value(), stream );
179 } else {
180 stream << toString();
181 }
182 return stream;
183 }
void toStream(std::ostream &out) const override
value -> stream
Definition Property.h:467

◆ find() [1/2]

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename K>
requires requires { value().find( key ); }
decltype(auto) Gaudi::Property< TYPE, VERIFIER, HANDLERS >::find ( const K & key)
inline

Definition at line 326 of file Property.h.

327 { value().find( key ); }
328 {
329 return value().find( key );
330 }
decltype(auto) key() const
Helpers for DataHandles and derived classes.
Definition Property.h:374

◆ find() [2/2]

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename K>
requires requires { value().find( key ); }
decltype(auto) Gaudi::Property< TYPE, VERIFIER, HANDLERS >::find ( const K & key) const
inline

Definition at line 320 of file Property.h.

321 { value().find( key ); }
322 {
323 return value().find( key );
324 }

◆ fromString()

template<class TYPE, class VERIFIER, class HANDLERS>
StatusCode Gaudi::Property< TYPE, VERIFIER, HANDLERS >::fromString ( const std::string & source)
inlineoverridevirtual

string -> value

Implements Gaudi::Details::PropertyBase.

Definition at line 434 of file Property.h.

434 {
435 try {
437 *this = Converter().fromString( m_value, source );
438 return StatusCode::SUCCESS;
439 } catch ( const std::exception& err ) {
442 const std::string errMsg =
443 "Cannot convert '" + source + "' for property '" + name() + "' in class '" + ownerTypeName() + "'";
444 switch ( parsingErrorPolicy() ) {
446 break;
448 throw GaudiException( errMsg, "Property::fromString", StatusCode::FAILURE, err );
449 break;
451 std::cerr << "WARNING: " << errMsg << "': " << err.what() << '\n';
452 break;
454 std::cerr << "FATAL: " << errMsg << "': " << err.what() << '\n';
455 std::abort();
456 break;
457 }
458 return StatusCode::FAILURE;
459 }
460 }
std::string ownerTypeName() const
get the string for the type of the owner class (used for documentation)

◆ fullKey()

template<class TYPE, class VERIFIER, class HANDLERS>
decltype(auto) Gaudi::Property< TYPE, VERIFIER, HANDLERS >::fullKey ( ) const
inline

Definition at line 384 of file Property.h.

385 { value().fullKey(); }
386 {
387 return value().fullKey();
388 }

◆ initialize()

template<class TYPE, class VERIFIER, class HANDLERS>
decltype(auto) Gaudi::Property< TYPE, VERIFIER, HANDLERS >::initialize ( )
inline

Definition at line 389 of file Property.h.

390 { value().initialize(); }
391 {
392 return value().initialize();
393 }

◆ key()

template<class TYPE, class VERIFIER, class HANDLERS>
decltype(auto) Gaudi::Property< TYPE, VERIFIER, HANDLERS >::key ( ) const
inline

Helpers for DataHandles and derived classes.

Definition at line 374 of file Property.h.

375 { value().key(); }
376 {
377 return value().key();
378 }

◆ length()

template<class TYPE, class VERIFIER, class HANDLERS>
auto Gaudi::Property< TYPE, VERIFIER, HANDLERS >::length ( ) const
inline

Definition at line 272 of file Property.h.

273 { value().length(); }
274 {
275 return value().length();
276 }

◆ load()

template<class TYPE, class VERIFIER, class HANDLERS>
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::load ( Details::PropertyBase & dest) const
inlineoverridevirtual

set value to another property

Implements Gaudi::Details::PropertyBase.

Definition at line 429 of file Property.h.

429 {
430 // delegate to the 'opposite' method
431 return dest.assign( *this );
432 }
bool assign(const Details::PropertyBase &source) override
get the value from another property
Definition Property.h:417

◆ makeHandles() [1/2]

template<class TYPE, class VERIFIER, class HANDLERS>
decltype(auto) Gaudi::Property< TYPE, VERIFIER, HANDLERS >::makeHandles ( ) const
inline

Definition at line 394 of file Property.h.

395 { value().makeHandles(); }
396 {
397 return value().makeHandles();
398 }

◆ makeHandles() [2/2]

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename ARG>
requires requires { value().makeHandles( arg ); }
decltype(auto) Gaudi::Property< TYPE, VERIFIER, HANDLERS >::makeHandles ( const ARG & arg) const
inline

Definition at line 400 of file Property.h.

401 { value().makeHandles( arg ); }
402 {
403 return value().makeHandles( arg );
404 }

◆ objKey()

template<class TYPE, class VERIFIER, class HANDLERS>
decltype(auto) Gaudi::Property< TYPE, VERIFIER, HANDLERS >::objKey ( ) const
inline

Definition at line 379 of file Property.h.

380 { value().objKey(); }
381 {
382 return value().objKey();
383 }

◆ operator const ValueType &()

template<class TYPE, class VERIFIER, class HANDLERS>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator const ValueType & ( ) const
inline

Automatic conversion to value (const reference).

Definition at line 156 of file Property.h.

156 {
157 m_handlers.useReadHandler( *this );
158 return m_value;
159 }

◆ operator std::string_view() [1/2]

template<class TYPE, class VERIFIER, class HANDLERS>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator std::string_view ( ) const
inline

Definition at line 166 of file Property.h.

168 {
169 m_handlers.useReadHandler( *this );
170 return m_value;
171 }

◆ operator std::string_view() [2/2]

template<class TYPE, class VERIFIER, class HANDLERS>
Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator std::string_view ( ) const
inline

Definition at line 185 of file Property.h.

185 {
186 m_handlers.useReadHandler( *this );
187 return m_value;
188 }

◆ operator!=()

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename T>
requires requires { { m_value != other } -> std::convertible_to<bool>; }
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator!= ( const T & other) const
inline

inequality comparison

Definition at line 202 of file Property.h.

203 {
205 }
206 {
207 return m_value != other;
208 }

◆ operator()()

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename... Args>
requires std::invocable<ValueType&, Args...>
decltype(auto) Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator() ( Args &&... args) const
inlineconstexprnoexcept

Definition at line 410 of file Property.h.

411 {
412 return std::invoke( value(), std::forward<Args>( args )... );
413 }

◆ operator+()

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename T>
requires requires { m_value + other; }
auto Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator+ ( const T & other) const
inline

allow addition if possible between the property and the other types

Definition at line 222 of file Property.h.

223 { m_value + other; }
224 {
225 return m_value + other;
226 }

◆ operator++() [1/2]

template<class TYPE, class VERIFIER, class HANDLERS>
Property & Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator++ ( )
inline

Definition at line 337 of file Property.h.

338 { ++m_value; }
339 {
340 ++value();
341 return *this;
342 }

◆ operator++() [2/2]

template<class TYPE, class VERIFIER, class HANDLERS>
auto Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator++ ( int )
inline

Definition at line 343 of file Property.h.

344 { m_value++; }
345 {
346 return m_value++;
347 }

◆ operator+=()

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename T>
requires requires { m_value += other; }
Property & Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator+= ( const T & other)
inline

Definition at line 360 of file Property.h.

361 { m_value += other; }
362 {
363 m_value += other;
364 return *this;
365 }

◆ operator--() [1/2]

template<class TYPE, class VERIFIER, class HANDLERS>
Property & Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator-- ( )
inline

Definition at line 348 of file Property.h.

349 { --value(); }
350 {
351 --value();
352 return *this;
353 }

◆ operator--() [2/2]

template<class TYPE, class VERIFIER, class HANDLERS>
auto Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator-- ( int )
inline

Definition at line 354 of file Property.h.

355 { m_value--; }
356 {
357 return m_value--;
358 }

◆ operator-=()

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename T>
requires requires { m_value -= other; }
Property & Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator-= ( const T & other)
inline

Definition at line 367 of file Property.h.

368 { m_value -= other; }
369 {
370 m_value -= other;
371 return *this;
372 }

◆ operator<()

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename T>
requires requires { { m_value < other } -> std::convertible_to<bool>; }
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator< ( const T & other) const
inline

"less" comparison

Definition at line 212 of file Property.h.

213 {
215 }
216 {
217 return m_value < other;
218 }

◆ operator=() [1/2]

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename T = TYPE>
requires requires { typename T::value_type; } && std::constructible_from<TYPE, std::initializer_list<typename T::value_type>>
Property & Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator= ( std::initializer_list< typename T::value_type > ilist)
inline

Definition at line 241 of file Property.h.

241 {
242 return *this = TYPE{ ilist };
243 }

◆ operator=() [2/2]

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename T>
requires ( std::assignable_from<TYPE&, T &&> || std::constructible_from<TYPE, T &&> )
Property & Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator= ( T && v)
inline

Assignment from value.

Definition at line 231 of file Property.h.

231 {
232 m_verifier( v );
234 m_handlers.useUpdateHandler( *this );
235 return *this;
236 }

◆ operator==()

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename T>
requires requires { { m_value == other } -> std::convertible_to<bool>; }
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator== ( const T & other) const
inline

equality comparison

Definition at line 192 of file Property.h.

193 {
195 }
196 {
197 return m_value == other;
198 }

◆ operator[]() [1/2]

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename ARG>
requires requires { value()[arg]; }
decltype(auto) Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator[] ( const ARG & arg)
inline

Definition at line 314 of file Property.h.

315 { value()[arg]; }
316 {
317 return value()[arg];
318 }

◆ operator[]() [2/2]

template<class TYPE, class VERIFIER, class HANDLERS>
template<typename ARG>
requires requires { value()[arg]; }
decltype(auto) Gaudi::Property< TYPE, VERIFIER, HANDLERS >::operator[] ( const ARG & arg) const
inline

Definition at line 308 of file Property.h.

309 { value()[arg]; }
310 {
311 return value()[arg];
312 }

◆ readCallBack()

template<class TYPE, class VERIFIER, class HANDLERS>
const std::function< void(Details::PropertyBase &)> Gaudi::Property< TYPE, VERIFIER, HANDLERS >::readCallBack ( ) const
inlineoverridevirtual

get a reference to the readCallBack

Implements Gaudi::Details::PropertyBase.

Definition at line 141 of file Property.h.

141 {
142 return m_handlers.getReadHandler();
143 }

◆ set()

template<class TYPE, class VERIFIER, class HANDLERS>
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::set ( const ValueType & v)
inline

Definition at line 257 of file Property.h.

257 {
258 *this = v;
259 return true;
260 }

◆ setValue()

template<class TYPE, class VERIFIER, class HANDLERS>
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::setValue ( const ValueType & v)
inline

Definition at line 253 of file Property.h.

253 {
254 *this = v;
255 return true;
256 }

◆ size()

template<class TYPE, class VERIFIER, class HANDLERS>
auto Gaudi::Property< TYPE, VERIFIER, HANDLERS >::size ( ) const
inline

Definition at line 267 of file Property.h.

268 { value().size(); }
269 {
270 return value().size();
271 }

◆ toStream()

template<class TYPE, class VERIFIER, class HANDLERS>
void Gaudi::Property< TYPE, VERIFIER, HANDLERS >::toStream ( std::ostream & out) const
inlineoverridevirtual

value -> stream

Implements Gaudi::Details::PropertyBase.

Definition at line 467 of file Property.h.

467 {
468 m_handlers.useReadHandler( *this );
469 using Utils::toStream;
470 toStream( m_value, out );
471 }

◆ toString()

template<class TYPE, class VERIFIER, class HANDLERS>
std::string Gaudi::Property< TYPE, VERIFIER, HANDLERS >::toString ( ) const
inlineoverridevirtual

value -> string

Implements Gaudi::Details::PropertyBase.

Definition at line 462 of file Property.h.

462 {
464 return Converter().toString( *this );
465 }

◆ updateCallBack()

template<class TYPE, class VERIFIER, class HANDLERS>
const std::function< void(Details::PropertyBase &)> Gaudi::Property< TYPE, VERIFIER, HANDLERS >::updateCallBack ( ) const
inlineoverridevirtual

get a reference to the updateCallBack

Implements Gaudi::Details::PropertyBase.

Definition at line 145 of file Property.h.

145 {
146 return m_handlers.getUpdateHandler();
147 }

◆ useUpdateHandler()

template<class TYPE, class VERIFIER, class HANDLERS>
bool Gaudi::Property< TYPE, VERIFIER, HANDLERS >::useUpdateHandler ( )
inlineoverridevirtual

manual trigger for callback for update

Implements Gaudi::Details::PropertyBase.

Definition at line 150 of file Property.h.

150 {
151 m_handlers.useUpdateHandler( *this );
152 return true;
153 }

◆ value() [1/2]

template<class TYPE, class VERIFIER, class HANDLERS>
ValueType & Gaudi::Property< TYPE, VERIFIER, HANDLERS >::value ( )
inline

Definition at line 252 of file Property.h.

252{ return const_cast<ValueType&>( (const ValueType&)*this ); }

◆ value() [2/2]

template<class TYPE, class VERIFIER, class HANDLERS>
const ValueType & Gaudi::Property< TYPE, VERIFIER, HANDLERS >::value ( ) const
inline

Definition at line 251 of file Property.h.

251{ return *this; }

◆ verifier() [1/2]

template<class TYPE, class VERIFIER, class HANDLERS>
VerifierType & Gaudi::Property< TYPE, VERIFIER, HANDLERS >::verifier ( )
inline

Accessor to verifier.

Definition at line 248 of file Property.h.

248{ return m_verifier; }

◆ verifier() [2/2]

template<class TYPE, class VERIFIER, class HANDLERS>
const VerifierType & Gaudi::Property< TYPE, VERIFIER, HANDLERS >::verifier ( ) const
inline

Accessor to verifier.

Definition at line 246 of file Property.h.

246{ return m_verifier; }

Member Data Documentation

◆ m_handlers

template<class TYPE, class VERIFIER, class HANDLERS>
HandlersType Gaudi::Property< TYPE, VERIFIER, HANDLERS >::m_handlers
private

Definition at line 46 of file Property.h.

◆ m_value

template<class TYPE, class VERIFIER, class HANDLERS>
StorageType Gaudi::Property< TYPE, VERIFIER, HANDLERS >::m_value
private

Definition at line 44 of file Property.h.

◆ m_verifier

template<class TYPE, class VERIFIER, class HANDLERS>
VerifierType Gaudi::Property< TYPE, VERIFIER, HANDLERS >::m_verifier
private

Definition at line 45 of file Property.h.


The documentation for this class was generated from the following files: