![]() |
The Gaudi Framework
master (42b00024)
|
Helper class to implement the IProperty interface. More...
#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/PropertyHolder.h>
Classes | |
struct | RemProperty |
Public Types | |
using | PropertyHolderImpl = PropertyHolder< BASE > |
Typedef used to refer to this class from derived classes, as in. More... | |
Public Member Functions | |
PropertyHolder ()=default | |
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop) |
Declare a property. More... | |
template<typename TYPE > | |
requires (!Gaudi::Details::is_gaudi_property_v< TYPE >) Gaudi | |
Helper to wrap a regular data member and use it as a regular property. More... | |
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 std::string &name, const Gaudi::Details::PropertyBase &p) override |
set the property from another property with a different name More... | |
StatusCode | setProperty (const std::string &s) override |
set the property from the formatted string More... | |
StatusCode | setPropertyRepr (const std::string &n, const std::string &r) override |
set the property from name and value string representation More... | |
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override |
get the property More... | |
const Gaudi::Details::PropertyBase & | getProperty (std::string_view name) const override |
get the property by name More... | |
StatusCode | getProperty (std::string_view 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 (std::string_view name) const override |
Return true if we have a property with the given name. More... | |
Gaudi::Details::PropertyBase * | property (std::string_view name) const |
\fixme property and bindPropertiesTo should be protected More... | |
void | bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc) |
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) |
Set the property from a property. More... | |
virtual StatusCode | setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p)=0 |
Set the property from a property with a different name. More... | |
virtual StatusCode | setProperty (const std::string &s)=0 |
Set the property by string. More... | |
StatusCode | setProperty (const std::string &name, const char *v) |
Special case for string literals. More... | |
StatusCode | setProperty (const std::string &name, const std::string &v) |
Special case for std::string. More... | |
PropertyHolder (const PropertyHolder &)=delete | |
PropertyHolder & | operator= (const PropertyHolder &)=delete |
Private Types | |
typedef std::vector< Gaudi::Details::PropertyBase * > | Properties |
typedef std::vector< RemProperty > | RemoteProperties |
Private Member Functions | |
Gaudi::Details::PropertyBase * | property (std::string_view name, const std::vector< Gaudi::Details::PropertyBase * > &props) const |
get the property by name form the proposed list More... | |
void | assertUniqueName (std::string_view 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 77 of file PropertyHolder.h.
|
private |
Definition at line 285 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 88 of file PropertyHolder.h.
|
private |
Definition at line 291 of file PropertyHolder.h.
|
default |
|
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 275 of file PropertyHolder.h.
|
inline |
Definition at line 255 of file PropertyHolder.h.
|
inline |
Declare a PropertyBase instance setting name and documentation.
Definition at line 130 of file PropertyHolder.h.
|
inline |
Declare a property.
Record a PropertyBase instance to be managed by PropertyHolder.
Definition at line 101 of file PropertyHolder.h.
|
inline |
Declare a remote property.
Bind name
to the property rname
of rsvc
.
Definition at line 142 of file PropertyHolder.h.
|
inlineoverride |
|
inlineoverride |
|
inlineoverride |
convert the property to the string
Definition at line 213 of file PropertyHolder.h.
|
inlineoverride |
|
inlineoverride |
Return true if we have a property with the given name.
Definition at line 230 of file PropertyHolder.h.
|
delete |
|
inline |
\fixme property and bindPropertiesTo should be protected
Definition at line 241 of file PropertyHolder.h.
|
inlineprivate |
|
inline |
Helper to wrap a regular data member and use it as a regular property.
Definition at line 110 of file PropertyHolder.h.
|
inline |
|
inline |
|
inlineoverride |
set the property from another property with a different name
Definition at line 160 of file PropertyHolder.h.
virtual StatusCode IProperty::setProperty |
Set the property from a property with a different name.
|
inline |
|
inlineoverride |
set the property from the formatted string
Definition at line 169 of file PropertyHolder.h.
virtual StatusCode IProperty::setProperty |
Set the property by string.
|
inlineoverride |
set the property from name and value string representation
@fixme SUCCESS is not required to be checked for compatibility with Gaudi::Utils::setProperty
Definition at line 180 of file PropertyHolder.h.
|
private |
Collection of all declared properties.
Definition at line 294 of file PropertyHolder.h.
|
private |
Collection of all declared remote properties.
Definition at line 296 of file PropertyHolder.h.
|
private |
Properties owned by PropertyHolder, to be deleted.
Definition at line 298 of file PropertyHolder.h.