![]() |
The Gaudi Framework
v28r2
|
Helper class to implement the IProperty interface. More...
#include <GaudiKernel/PropertyHolder.h>
Public Types | |
using | PropertyHolderImpl = PropertyHolder< BASE > |
Typedef used to refer to this class from derived classes, as in. More... | |
Public Member Functions | |
PropertyHolder ()=default | |
~PropertyHolder () override=default | |
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop) |
Declare a property. More... | |
template<class TYPE , typename = typename std::enable_if< !std::is_base_of<GaudiHandleBase,TYPE>::value && !std::is_base_of<GaudiHandleArrayBase,TYPE>::value && !std::is_base_of<DataObjectHandleBase,TYPE>::value >::type> | |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none") |
Helper to wrap a regular data member and use it as a regular property. More... | |
template<class TYPE , typename = typename std::enable_if< !std::is_base_of<GaudiHandleBase,TYPE>::value && !std::is_base_of<GaudiHandleArrayBase,TYPE>::value && !std::is_base_of<DataObjectHandleBase,TYPE>::value >::type> | |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none") const |
template<class TYPE , class VERIFIER , class HANDLERS > | |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none") |
Declare a PropertyBase instance setting name and documentation. More... | |
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") |
Declare a remote property. More... | |
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override |
set the property form another property More... | |
StatusCode | setProperty (const std::string &s) override |
set the property from the formatted string More... | |
StatusCode | setProperty (const std::string &n, const std::string &v) override |
set the property from name and the value More... | |
template<class TYPE > | |
StatusCode | setProperty (const std::string &name, const TYPE &value) |
set the property form the value More... | |
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override |
get the property More... | |
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override |
get the property by name More... | |
StatusCode | getProperty (const std::string &n, std::string &v) const override |
convert the property to the string More... | |
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override |
get all properties More... | |
bool | hasProperty (const std::string &name) const override |
Return true if we have a property with the given name. More... | |
PropertyHolder (const PropertyHolder &)=delete | |
PropertyHolder & | operator= (const PropertyHolder &)=delete |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none") |
Specializations for various GaudiHandles. More... | |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none") |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none") |
Protected Member Functions | |
Gaudi::Details::PropertyBase * | property (const std::string &name) const |
Private Types | |
typedef std::vector< Gaudi::Details::PropertyBase * > | Properties |
typedef std::pair< std::string, std::pair< IProperty *, std::string > > | RemProperty |
typedef std::vector< RemProperty > | RemoteProperties |
Private Member Functions | |
Gaudi::Details::PropertyBase * | property (const std::string &name, const std::vector< Gaudi::Details::PropertyBase * > &props) const |
get the property by name form the proposed list More... | |
void | assertUniqueName (const std::string &name) const |
Issue a runtime warning if the name is already present in the list of properties (see GAUDI-1023). More... | |
Private Attributes | |
Properties | m_properties |
Collection of all declared properties. More... | |
RemoteProperties | m_remoteProperties |
Collection of all declared remote properties. More... | |
std::vector< std::unique_ptr< Gaudi::Details::PropertyBase > > | m_todelete |
Properties owned by PropertyHolder, to be deleted. More... | |
Helper class to implement the IProperty interface.
PropertyHolder is used by components base classes (Algorithm, Service, etc.) to provide a default implementation the IProperty interface.
When needing to implement the IProperty interface in a class, it is enough to wrap the base of the class with PropertyHolder, as in
where BaseClass
should inherit from IProperty and INamedInterface.
Definition at line 73 of file PropertyHolder.h.
|
private |
Definition at line 392 of file PropertyHolder.h.
using PropertyHolder< BASE >::PropertyHolderImpl = PropertyHolder<BASE> |
Typedef used to refer to this class from derived classes, as in.
Definition at line 85 of file PropertyHolder.h.
|
private |
Definition at line 394 of file PropertyHolder.h.
|
private |
Definition at line 393 of file PropertyHolder.h.
|
default |
|
overridedefault |
|
delete |
prevent copies
|
inlineprivate |
Issue a runtime warning if the name is already present in the list of properties (see GAUDI-1023).
Definition at line 379 of file PropertyHolder.h.
|
inline |
Declare a property.
Record a PropertyBase instance to be managed by PropertyHolder.
Definition at line 99 of file PropertyHolder.h.
|
inline |
Helper to wrap a regular data member and use it as a regular property.
Definition at line 113 of file PropertyHolder.h.
|
inline |
Definition at line 130 of file PropertyHolder.h.
|
inline |
Declare a PropertyBase instance setting name and documentation.
Definition at line 138 of file PropertyHolder.h.
|
inline |
Specializations for various GaudiHandles.
Definition at line 166 of file PropertyHolder.h.
|
inline |
Definition at line 178 of file PropertyHolder.h.
|
inline |
Definition at line 190 of file PropertyHolder.h.
|
inline |
Declare a remote property.
Bind name
to the property rname
of rsvc
.
Definition at line 152 of file PropertyHolder.h.
|
inlineoverride |
get all properties
Definition at line 331 of file PropertyHolder.h.
|
inlineoverride |
get the property
Definition at line 293 of file PropertyHolder.h.
|
inlineoverride |
get the property by name
Definition at line 306 of file PropertyHolder.h.
|
inlineoverride |
convert the property to the string
Definition at line 316 of file PropertyHolder.h.
|
inlineoverride |
Return true if we have a property with the given name.
Definition at line 336 of file PropertyHolder.h.
|
delete |
|
inlineprotected |
Definition at line 345 of file PropertyHolder.h.
|
inlineprivate |
get the property by name form the proposed list
Definition at line 368 of file PropertyHolder.h.
|
inlineoverride |
set the property form another property
Definition at line 210 of file PropertyHolder.h.
|
inlineoverride |
set the property from the formatted string
Definition at line 225 of file PropertyHolder.h.
|
inlineoverride |
set the property from name and the value
Definition at line 239 of file PropertyHolder.h.
|
inline |
set the property form the value
Note: the interface IProperty allows setting of the properties either directly from other properties or from strings only
This is very convenient in resetting of the default properties in the derived classes. E.g. without this method one needs to convert everything into strings to use IProperty::setProperty
For simple cases it is more or less ok, but for complicated properties it is just ugly..
name | name of the property |
value | value of the property |
Definition at line 285 of file PropertyHolder.h.
|
private |
Collection of all declared properties.
Definition at line 397 of file PropertyHolder.h.
|
private |
Collection of all declared remote properties.
Definition at line 399 of file PropertyHolder.h.
|
private |
Properties owned by PropertyHolder, to be deleted.
Definition at line 401 of file PropertyHolder.h.