1 #ifndef GAUDIKERNEL_PROPERTYHOLDER_H 2 #define GAUDIKERNEL_PROPERTYHOLDER_H 37 template <
typename TYPE,
typename VERIFIER,
typename HANDLERS>
52 [](
char c1,
char c2 ) {
return toupper( c1 ) ==
toupper( c2 ); } );
80 "PropertyHolder template argument must inherit from IProperty and INamedInterface" );
111 template <typename TYPE, typename = std::enable_if_t<!Gaudi::Details::is_gaudi_property<TYPE>::value>>
114 m_todelete.
push_back( std::make_unique<Gaudi::Details::PropertyType<TYPE&>>( name, value ) );
123 template <
class TYPE,
class VERIFIER,
class HANDLERS>
140 if ( !rsvc )
return nullptr;
225 template <
class TYPE>
307 return ( it != props.
end() ) ? *it :
nullptr;
318 log <<
MSG::WARNING <<
"duplicated property name '" << name <<
"', see https://its.cern.ch/jira/browse/GAUDI-1023" 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
constexpr static const auto FAILURE
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
Properties m_properties
Collection of all declared properties.
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::cpp17::detected_or_t< Gaudi::Property< T >, PropertyType_t, T > PropertyType
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
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)...
std::vector< RemProperty > RemoteProperties
PropertyMgr & operator=(const PropertyMgr &)=delete
typename std::remove_reference_t< T >::PropertyType PropertyType_t
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()
bool hasProperty(const std::string &name) const override
Return true if we have a property with the given name.
This class is used for returning status codes from appropriate routines.
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, TYPE &value, const std::string &doc="none")
Declare a property (templated)
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.
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
constexpr static const auto SUCCESS
virtual const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const =0
Get list of properties.
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.
AttribStringParser::Iterator begin(const AttribStringParser &parser)
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, TYPE &value, const std::string &doc="none")
Helper to wrap a regular data member and use it as a regular property.