1 #ifndef GAUDIKERNEL_PROPERTYHOLDER_H 2 #define GAUDIKERNEL_PROPERTYHOLDER_H 76 "PropertyHolder template argument must inherit from IProperty and INamedInterface" );
108 template <class TYPE, typename = typename std::enable_if<!std::is_base_of<GaudiHandleBase, TYPE>::value &&
122 template <class TYPE, typename = typename std::enable_if<!std::is_base_of<GaudiHandleBase, TYPE>::value &&
126 "Kept for backward compatibility, use the non-const version instead, will be removed in v29r0" )]] Gaudi::
127 Details::PropertyBase*
130 return const_cast<PropertyHolder*
>( this )->declareProperty<TYPE>( name, value, doc );
135 template <
class TYPE,
class VERIFIER,
class HANDLERS>
212 if ( pp && pp->
assign( p ) ) {
282 template <
class TYPE>
372 return ( it != props.
end() ) ? *it :
nullptr;
385 log <<
MSG::WARNING <<
"duplicated property name '" << name <<
"', see https://its.cern.ch/jira/browse/GAUDI-1023" Handle to be used in lieu of naked pointers to services.
const Gaudi::Details::PropertyBase & getProperty(const std::string &name) const override
get the property by name
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
StatusCode getProperty(Gaudi::Details::PropertyBase *p) const override
get the property
Definition of the MsgStream class used to transmit messages.
void setDocumentation(std::string value)
set the documentation string
StatusCode setProperty(const std::string &name, const TYPE &value)
set the property form the value
Gaudi::Details::PropertyBase * property(const std::string &name) const
Implementation of property with value of concrete type.
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
virtual bool load(PropertyBase &dest) const =0
export the property value to the destination
const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
get all properties
virtual bool assign(const PropertyBase &source)=0
import the property value form the source
const std::string name() const
property name
AttribStringParser::Iterator end(const AttribStringParser &)
Properties m_properties
Collection of all declared properties.
GAUDI_API bool hasProperty(const IProperty *p, const std::string &name)
simple function which check the existence of the property with the given name.
StatusCode getProperty(const std::string &n, std::string &v) const override
convert the property to the string
bool hasProperty(const std::string &name) const override
Return true if we have a property with the given name.
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, TYPE &value, const std::string &doc="none") const
Gaudi::Details::PropertyBase * property(const std::string &name) const
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Details::PropertyBase &prop)
Declare a property.
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
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
void assertUniqueName(const std::string &name) const
Throw an exception if the name is already present in the list of properties (see GAUDI-1023).
virtual std::string toString() const =0
value -> string
bool isFailure() const
Test for a status code of FAILURE.
std::vector< Gaudi::Details::PropertyBase * > Properties
virtual StatusCode fromString(const std::string &value)=0
string -> value
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)...
DataObjectHandleProperty.h GaudiKernel/DataObjectHandleProperty.h.
std::vector< RemProperty > RemoteProperties
PropertyMgr & operator=(const PropertyMgr &)=delete
DataObjectHandle.h GaudiKernel/DataObjectHandle.h.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
RemoteProperties m_remoteProperties
Collection of all declared remote properties.
GAUDI_API ISvcLocator * svcLocator()
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
Specializations for various GaudiHandles.
This class is used for returning status codes from appropriate routines.
bool iequal(const std::string &v1, const std::string &v2)
Helper for case insensitive string comparison.
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.
The IMessage is the interface implemented by the message service.
Array of Handles to be used in lieu of vector of naked pointers to tools.
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
std::pair< std::string, std::pair< IProperty *, std::string > > RemProperty
void setName(std::string value)
set the new value for the property name
virtual const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const =0
Get list of properties.
Base class of array's of various gaudihandles.
DataObjectHandleBase GaudiKernel/DataObjectHandleBase.h.
StatusCode setProperty(const std::string &n, const std::string &v) override
set the property from name and the value
Properties m_properties
Collection of all declared properties.
Helper class to implement the IProperty interface.
std::vector< std::unique_ptr< Gaudi::Details::PropertyBase > > m_todelete
Properties to be deleted.
Base class to handles to be used in lieu of naked pointers to various Gaudi components.
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
Gaudi::Details::PropertyBase * declareRemoteProperty(const std::string &name, IProperty *rsvc, const std::string &rname="")
Declare a remote property.
The IProperty is the basic interface for all components which have properties that can be set or get...
std::vector< std::unique_ptr< Gaudi::Details::PropertyBase > > m_todelete
Properties owned by PropertyHolder, to be deleted.
StatusCode setProperty(const std::string &s) override
set the property from the formatted string
void toupper(std::string &s)
Helper functions to set/get the application return code.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
RemoteProperties m_remoteProperties
Collection of all declared remote properties.
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
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.