| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
PropertyMgr Class Reference

Property manager helper class. More...

`#include <GaudiKernel/PropertyMgr.h>`

Inheritance diagram for PropertyMgr:
[legend]
Collaboration diagram for PropertyMgr:
[legend]

## Public Member Functions
| PropertyMgr (IInterface *iface=nullptr)
| constructor from the interface More...
| PropertyMgr (const PropertyMgr &)=delete
PropertyMgr & | operator= (const PropertyMgr &)=delete
template<class TYPE , typename = std::enable_if_t<!std::is_base_of_v<GaudiHandleBase, TYPE> && !std::is_base_of_v<GaudiHandleArrayBase, TYPE> && !std::is_base_of_v<DataObjectHandleBase, TYPE>>>
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Declare a property (templated) More...
template<class TYPE >
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE > &prop, const std::string &doc="none")
| Declare a property (specialization) More...
template<class TYPE >
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE & > &prop, const std::string &doc="none")
| Declare a property (specialization) More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
| Declare a property (specialization) More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
| Declare a property (specialization) More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
| Declare a property (specialization) 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 property formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and 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...
StatusCode | queryInterface (const InterfaceID &iid, void **pinterface) override
Public Member Functions inherited from implements< IProperty >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| implements ()=default
| Default constructor. More...
| implements (const implements &)
| Copy constructor (zero the reference count) More...
implements & | operator= (const implements &)
| Assignment operator (do not touch the reference count). More...
unsigned long | addRef () override
| Reference Interface instance. More...
unsigned long | release () override
| Release Interface instance. More...
unsigned long | refCount () const override
| Current reference count. More...

## 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
| Throw an exception 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 to be deleted. More...
IInterface * | m_pOuter
| Interface hub reference (ApplicationMgr) More...

## Additional Inherited Members
Public Types inherited from implements< IProperty >
using | base_class = implements< Interfaces... >
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces... >
| Typedef to the base of this class. More...
using | iids = typename extend_interfaces_base::ext_iids
Public Types inherited from extend_interfaces< Interfaces... >
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
| take union of the ext_iids of all Interfaces... More...
Protected Attributes inherited from implements< IProperty >
std::atomic_ulong | m_refCount
| Reference counter. More...

## Detailed Description

Property manager helper class.

This class is used by algorithms and services for helping to manage its own set of properties. It implements the IProperty interface.

Author
  Paul Maley
  David Quarrie

Deprecated:
  will be removed in v29r0, consider using PropertyHolder instead

Definition at line 33 of file PropertyMgr.h.

## Member Typedef Documentation

## ◆ Properties

typedef std::vector<Gaudi::Details::PropertyBase*> PropertyMgr::Properties
| private

Definition at line 132 of file PropertyMgr.h.

## ◆ RemoteProperties

typedef std::vector<RemProperty> PropertyMgr::RemoteProperties
| private

Definition at line 134 of file PropertyMgr.h.

## ◆ RemProperty

typedef std::pair<std::string, std::pair<IProperty*, std::string> > PropertyMgr::RemProperty
| private

Definition at line 133 of file PropertyMgr.h.

## Constructor & Destructor Documentation

## ◆ PropertyMgr() [1/2]

PropertyMgr::PropertyMgr | ( | IInterface * | iface = `nullptr` | ) |

constructor from the interface

Definition at line 48 of file PropertyMgr.cpp.

48 : m_pOuter( iface ) {
49 addRef(); // initial reference count set to 1
50 }
PropertyMgr::m_pOuter
IInterface * m_pOuter
Interface hub reference (ApplicationMgr)
Definition: PropertyMgr.h:143
implements< IProperty >::addRef
unsigned long addRef() override
Reference Interface instance.
Definition: implements.h:38

## ◆ PropertyMgr() [2/2]

PropertyMgr::PropertyMgr | ( | const PropertyMgr & |  | ) |
| delete

## Member Function Documentation

## ◆ assertUniqueName()

void PropertyMgr::assertUniqueName | ( | const std::string & | name | ) | const
| private

Throw an exception if the name is already present in the list of properties (see GAUDI-1023).

Definition at line 212 of file PropertyMgr.cpp.

212 {
213 if ( LIKELY( !hasProperty( name ) ) ) return;
214 auto msgSvc = Gaudi::svcLocator()->service<IMessageSvc>( "MessageSvc" );
215 if ( !msgSvc ) std::cerr << "error: cannot get MessageSvc!" << std::endl;
216 auto owner = SmartIF<INamedInterface>( m_pOuter );
217 MsgStream log( msgSvc, owner ? owner->name() : "PropertyMgr" );
218 log << MSG::WARNING << "duplicated property name '" << name << "', see https://its.cern.ch/jira/browse/GAUDI-1023"
219 << endmsg;
220 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
SmartIF< INamedInterface >
PropertyMgr::m_pOuter
IInterface * m_pOuter
Interface hub reference (ApplicationMgr)
Definition: PropertyMgr.h:143
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
std::endl
T endl(T... args)
AvalancheSchedulerErrorTest.msgSvc
msgSvc
Definition: AvalancheSchedulerErrorTest.py:67
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:76
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
IMessageSvc
The IMessage is the interface implemented by the message service.
Definition: IMessageSvc.h:37
LIKELY
#define LIKELY(x)
Definition: Kernel.h:95
PropertyMgr::hasProperty
bool hasProperty(const std::string &name) const override
Return true if we have a property with the given name.
Definition: PropertyMgr.cpp:208
MSG::WARNING
Definition: IMessageSvc.h:15
std::cerr
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## ◆ declareProperty() [1/6]

template<class TYPE , typename >

Gaudi::Details::PropertyBase * PropertyMgr::declareProperty | ( | const std::string & | name,
|  | TYPE & | value,
|  | const std::string & | doc = `"none"`
| ) |  |
| inline

Declare a property (templated)

Definition at line 149 of file PropertyMgr.h.

150 {
151 assertUniqueName( name );
152 m_todelete.emplace_back( new Gaudi::Property<TYPE&>( name, value ) );
153 Gaudi::Details::PropertyBase* p = m_todelete.back().get();
154 //
155 p->setDocumentation( doc );
156 m_properties.push_back( p );
157 //
158 return p;
159 }
PropertyMgr::m_todelete
std::vector< std::unique_ptr< Gaudi::Details::PropertyBase > > m_todelete
Properties to be deleted.
Definition: PropertyMgr.h:141
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Gaudi::Details::PropertyBase::setDocumentation
void setDocumentation(std::string value)
set the documentation string
Definition: Property.h:86
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
PropertyMgr::assertUniqueName
void assertUniqueName(const std::string &name) const
Throw an exception if the name is already present in the list of properties (see GAUDI-1023).
Definition: PropertyMgr.cpp:212
std::vector::push_back
T push_back(T... args)
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:137
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
std::unique_ptr::get
T get(T... args)
std::vector::back
T back(T... args)
std::vector::emplace_back
T emplace_back(T... args)

## ◆ declareProperty() [2/6]

template<class TYPE >

Gaudi::Details::PropertyBase * PropertyMgr::declareProperty | ( | const std::string & | name,
|  | Gaudi::Property< TYPE > & | prop,
|  | const std::string & | doc = `"none"`
| ) |  |
| inline

Declare a property (specialization)

Declare a property (templated)

Definition at line 164 of file PropertyMgr.h.

165 {
166 assertUniqueName( name );
167 Gaudi::Details::PropertyBase* p = &prop;
168 //
169 p->setName( name );
170 p->setDocumentation( doc );
171 m_properties.push_back( p );
172 //
173 return p;
174 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Gaudi::Details::PropertyBase::setDocumentation
void setDocumentation(std::string value)
set the documentation string
Definition: Property.h:86
PropertyMgr::assertUniqueName
void assertUniqueName(const std::string &name) const
Throw an exception if the name is already present in the list of properties (see GAUDI-1023).
Definition: PropertyMgr.cpp:212
std::vector::push_back
T push_back(T... args)
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:137
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
Gaudi::Details::PropertyBase::setName
void setName(std::string value)
set the new value for the property name
Definition: Property.h:84

## ◆ declareProperty() [3/6]

template<class TYPE >

Gaudi::Details::PropertyBase * PropertyMgr::declareProperty | ( | const std::string & | name,
|  | Gaudi::Property< TYPE & > & | prop,
|  | const std::string & | doc = `"none"`
| ) |  |
| inline

Declare a property (specialization)

Declare a property.

Definition at line 180 of file PropertyMgr.h.

180 {
181 assertUniqueName( name );
182 Gaudi::Details::PropertyBase* p = &prop;
183 //
184 p->setName( name );
185 p->setDocumentation( doc );
186 m_properties.push_back( p );
187 //
188 return p;
189 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Gaudi::Details::PropertyBase::setDocumentation
void setDocumentation(std::string value)
set the documentation string
Definition: Property.h:86
PropertyMgr::assertUniqueName
void assertUniqueName(const std::string &name) const
Throw an exception if the name is already present in the list of properties (see GAUDI-1023).
Definition: PropertyMgr.cpp:212
std::vector::push_back
T push_back(T... args)
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:137
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
Gaudi::Details::PropertyBase::setName
void setName(std::string value)
set the new value for the property name
Definition: Property.h:84

## ◆ declareProperty() [4/6]

PropertyBase * PropertyMgr::declareProperty | ( | const std::string & | name,
|  | GaudiHandleBase & | ref,
|  | const std::string & | doc = `"none"`
| ) |  |

Declare a property (specialization)

Definition at line 64 of file PropertyMgr.cpp.

64 {
65 assertUniqueName( name );
66 m_todelete.emplace_back( new typename GaudiHandleBase::PropertyType( name, ref ) );
67 Property* p = m_todelete.back().get();
68 //
69 p->setDocumentation( doc );
70 m_properties.push_back( p );
71 //
72 return p;
73 }
PropertyMgr::m_todelete
std::vector< std::unique_ptr< Gaudi::Details::PropertyBase > > m_todelete
Properties to be deleted.
Definition: PropertyMgr.h:141
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Gaudi::Details::PropertyBase::setDocumentation
void setDocumentation(std::string value)
set the documentation string
Definition: Property.h:86
GaudiHandleProperty
Definition: Property.h:845
Property
Gaudi::Details::PropertyBase Property
\fixme backward compatibility hack for old Property base class
Definition: PropertyFwd.h:25
PropertyMgr::assertUniqueName
void assertUniqueName(const std::string &name) const
Throw an exception if the name is already present in the list of properties (see GAUDI-1023).
Definition: PropertyMgr.cpp:212
compareRootHistos.ref
string ref
Definition: compareRootHistos.py:14
std::vector::push_back
T push_back(T... args)
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:137
std::unique_ptr::get
T get(T... args)
std::vector::back
T back(T... args)
std::vector::emplace_back
T emplace_back(T... args)

## ◆ declareProperty() [5/6]

PropertyBase * PropertyMgr::declareProperty | ( | const std::string & | name,
|  | GaudiHandleArrayBase & | ref,
|  | const std::string & | doc = `"none"`
| ) |  |

Declare a property (specialization)

Definition at line 75 of file PropertyMgr.cpp.

76 {
77 assertUniqueName( name );
78 m_todelete.emplace_back( new typename GaudiHandleArrayBase::PropertyType( name, ref ) );
79 Property* p = m_todelete.back().get();
80 //
81 p->setDocumentation( doc );
82 m_properties.push_back( p );
83 //
84 return p;
85 }
PropertyMgr::m_todelete
std::vector< std::unique_ptr< Gaudi::Details::PropertyBase > > m_todelete
Properties to be deleted.
Definition: PropertyMgr.h:141
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Gaudi::Details::PropertyBase::setDocumentation
void setDocumentation(std::string value)
set the documentation string
Definition: Property.h:86
Property
Gaudi::Details::PropertyBase Property
\fixme backward compatibility hack for old Property base class
Definition: PropertyFwd.h:25
PropertyMgr::assertUniqueName
void assertUniqueName(const std::string &name) const
Throw an exception if the name is already present in the list of properties (see GAUDI-1023).
Definition: PropertyMgr.cpp:212
compareRootHistos.ref
string ref
Definition: compareRootHistos.py:14
std::vector::push_back
T push_back(T... args)
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:137
std::unique_ptr::get
T get(T... args)
std::vector::back
T back(T... args)
GaudiHandleArrayProperty
Definition: Property.h:882
std::vector::emplace_back
T emplace_back(T... args)

## ◆ declareProperty() [6/6]

PropertyBase * PropertyMgr::declareProperty | ( | const std::string & | name,
|  | DataObjectHandleBase & | ref,
|  | const std::string & | doc = `"none"`
| ) |  |

Declare a property (specialization)

Definition at line 88 of file PropertyMgr.cpp.

89 {
90 assertUniqueName( name );
91 m_todelete.emplace_back( new typename DataObjectHandleBase::PropertyType( name, ref ) );
92 Property* p = m_todelete.back().get();
93 //
94 p->setDocumentation( doc );
95 m_properties.push_back( p );
96 //
97 return p;
98 }
PropertyMgr::m_todelete
std::vector< std::unique_ptr< Gaudi::Details::PropertyBase > > m_todelete
Properties to be deleted.
Definition: PropertyMgr.h:141
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Gaudi::Details::PropertyBase::setDocumentation
void setDocumentation(std::string value)
set the documentation string
Definition: Property.h:86
Property
Gaudi::Details::PropertyBase Property
\fixme backward compatibility hack for old Property base class
Definition: PropertyFwd.h:25
PropertyMgr::assertUniqueName
void assertUniqueName(const std::string &name) const
Throw an exception if the name is already present in the list of properties (see GAUDI-1023).
Definition: PropertyMgr.cpp:212
DataObjectHandleProperty
DataObjectHandleProperty.h GaudiKernel/DataObjectHandleProperty.h.
Definition: DataObjectHandleProperty.h:23
compareRootHistos.ref
string ref
Definition: compareRootHistos.py:14
std::vector::push_back
T push_back(T... args)
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:137
std::unique_ptr::get
T get(T... args)
std::vector::back
T back(T... args)
std::vector::emplace_back
T emplace_back(T... args)

## ◆ declareRemoteProperty()

PropertyBase * PropertyMgr::declareRemoteProperty | ( | const std::string & | name,
|  | IProperty * | rsvc,
|  | const std::string & | rname = `""`
| ) |  |

Declare a remote property.

Definition at line 54 of file PropertyMgr.cpp.

54 {
55 if ( !rsvc ) return nullptr;
56 const std::string& nam = rname.empty() ? name : rname;
57 PropertyBase* p = property( nam, rsvc->getProperties() );
58 m_remoteProperties.emplace_back( name, std::make_pair( rsvc, nam ) );
59 return p;
60 }
std::string::empty
T empty(T... args)
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
std::string
STL class.
PropertyMgr::m_remoteProperties
RemoteProperties m_remoteProperties
Collection of all declared remote properties.
Definition: PropertyMgr.h:139
std::make_pair
T make_pair(T... args)
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
PropertyMgr::property
Gaudi::Details::PropertyBase * property(const std::string &name) const
Definition: PropertyMgr.cpp:109
IProperty::getProperties
virtual const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const =0
Get list of properties.
std::vector::emplace_back
T emplace_back(T... args)

## ◆ getProperties()

const std::vector< PropertyBase * > & PropertyMgr::getProperties | ( |  | ) | const
| override

get all properties

See also
  IProperty

Definition at line 194 of file PropertyMgr.cpp.

194 { return m_properties; }
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:137

## ◆ getProperty() [1/3]

StatusCode PropertyMgr::getProperty | ( | Gaudi::Details::PropertyBase * | p | ) | const
| override

get the property

See also
  IProperty

Definition at line 160 of file PropertyMgr.cpp.

160 {
161 try {
162 const PropertyBase* pp = property( p->name() );
163 if ( pp && pp->load( *p ) ) return StatusCode::SUCCESS; // RETURN
164 } catch ( ... ) {}
165 return StatusCode::FAILURE; // RETURN
166 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: Property.h:36
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
PropertyMgr::property
Gaudi::Details::PropertyBase * property(const std::string &name) const
Definition: PropertyMgr.cpp:109
compareOutputFiles.pp
pp
Definition: compareOutputFiles.py:495
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## ◆ getProperty() [2/3]

const PropertyBase & PropertyMgr::getProperty | ( | const std::string & | name | ) | const
| override

get the property by name

See also
  IProperty

Definition at line 172 of file PropertyMgr.cpp.

172 {
173 const PropertyBase* p = property( name );
174 if ( !p ) throw std::out_of_range( "Property " + name + " not found." ); // Not found
175 return *p; // RETURN
176 }
std::out_of_range
STL class.
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
PropertyMgr::property
Gaudi::Details::PropertyBase * property(const std::string &name) const
Definition: PropertyMgr.cpp:109

## ◆ getProperty() [3/3]

StatusCode PropertyMgr::getProperty | ( | const std::string & | n,
|  | std::string & | v
| ) |  | const
| override

convert the property to the string

See also
  IProperty

Definition at line 182 of file PropertyMgr.cpp.

182 {
183 // get the property
184 const PropertyBase* p = property( n );
185 if ( !p ) return StatusCode::FAILURE;
186 // convert the value into the string
187 v = p->toString();
188 //
189 return StatusCode::SUCCESS;
190 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:210
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
PropertyMgr::property
Gaudi::Details::PropertyBase * property(const std::string &name) const
Definition: PropertyMgr.cpp:109
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Gaudi::Details::PropertyBase::toString
virtual std::string toString() const =0
value -> string

## ◆ hasProperty()

bool PropertyMgr::hasProperty | ( | const std::string & | name | ) | const
| override

Return true if we have a property with the given name.

See also
  IProperty

Definition at line 208 of file PropertyMgr.cpp.

208 {
209 return any_of( begin( m_properties ), end( m_properties ),
210 [&name]( const PropertyBase* prop ) { return noCaseCmp( prop->name(), name ); } );
211 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: Property.h:36
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:137
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
IOTest.end
def end
Definition: IOTest.py:112
std::any_of
T any_of(T... args)
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:120

## ◆ operator=()

PropertyMgr& PropertyMgr::operator= | ( | const PropertyMgr & |  | ) |
| delete

## ◆ property() [1/2]

PropertyBase * PropertyMgr::property | ( | const std::string & | name | ) | const
| protected

Definition at line 109 of file PropertyMgr.cpp.

109 {
110 // local property ?
111 PropertyBase* lp = property( name, m_properties );
112 if ( lp ) return lp; // RETURN
113 // look for remote property
114 for ( const auto& it : m_remoteProperties ) {
115 if ( !noCaseCmp( it.first, name ) ) continue; // CONTINUE
116 const IProperty* p = it.second.first;
117 if ( !p ) continue;
118 return property( it.second.second, p->getProperties() ); // RETURN
119 }
120 return nullptr; // RETURN
121 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:137
PropertyMgr::m_remoteProperties
RemoteProperties m_remoteProperties
Collection of all declared remote properties.
Definition: PropertyMgr.h:139
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
PropertyMgr::property
Gaudi::Details::PropertyBase * property(const std::string &name) const
Definition: PropertyMgr.cpp:109
IProperty::getProperties
virtual const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const =0
Get list of properties.
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:20

## ◆ property() [2/2]

PropertyBase * PropertyMgr::property | ( | const std::string & | name,
|  | const std::vector< Gaudi::Details::PropertyBase * > & | props
| ) |  | const
| private

get the property by name form the proposed list

Definition at line 102 of file PropertyMgr.cpp.

102 {
103 auto it = std::find_if( props.begin(), props.end(), PropByName{name} );
104 return ( it != props.end() ) ? *it : nullptr; // RETURN
105 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
std::vector::end
T end(T... args)
std::find_if
T find_if(T... args)
std::vector::begin
T begin(T... args)

## ◆ queryInterface()

StatusCode PropertyMgr::queryInterface | ( | const InterfaceID & | iid,
|  | void ** | pinterface
| ) |  |
| override

Definition at line 198 of file PropertyMgr.cpp.

198 {
199 // try local interfaces
200 StatusCode sc = base_class::queryInterface( iid, pinterface );
201 if ( sc.isSuccess() ) return sc;
202 // fall back on the owner
203 return m_pOuter ? m_pOuter->queryInterface( iid, pinterface ) : sc; // FAILURE
204 }
PropertyMgr::m_pOuter
IInterface * m_pOuter
Interface hub reference (ApplicationMgr)
Definition: PropertyMgr.h:143
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
implements::queryInterface
StatusCode queryInterface(const InterfaceID &ti, void **pp) override
Implementation of IInterface::queryInterface.
Definition: implements.h:20
IInterface::queryInterface
virtual StatusCode queryInterface(const InterfaceID &ti, void **pp)=0
Set the void** to the pointer to the requested interface of the instance.

## ◆ setProperty() [1/3]

StatusCode PropertyMgr::setProperty | ( | const Gaudi::Details::PropertyBase & | p | ) |
| override

set the property form another property

See also
  IProperty

Definition at line 127 of file PropertyMgr.cpp.

127 {
128 PropertyBase* pp = property( p.name() );
129 try {
130 if ( pp && pp->assign( p ) ) return StatusCode::SUCCESS;
131 } // RETURN
132 catch ( ... ) {}
133 //
134 return StatusCode::FAILURE;
135 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
Gaudi::Details::PropertyBase::name
const std::string name() const
property name
Definition: Property.h:36
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
PropertyMgr::property
Gaudi::Details::PropertyBase * property(const std::string &name) const
Definition: PropertyMgr.cpp:109
compareOutputFiles.pp
pp
Definition: compareOutputFiles.py:495
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## ◆ setProperty() [2/3]

StatusCode PropertyMgr::setProperty | ( | const std::string & | s | ) |
| override

set the property from the property formatted string

See also
  IProperty

Definition at line 141 of file PropertyMgr.cpp.

141 {
142 std::string name, value;
143 StatusCode sc = Gaudi::Parsers::parse( name, value, i );
144 return sc.isFailure() ? sc : setProperty( name, value );
145 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
PropertyMgr::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
Definition: PropertyMgr.cpp:127
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:11
std::string
STL class.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130

## ◆ setProperty() [3/3]

StatusCode PropertyMgr::setProperty | ( | const std::string & | n,
|  | const std::string & | v
| ) |  |
| override

set the property from name and the value

See also
  IProperty

Definition at line 151 of file PropertyMgr.cpp.

151 {
152 PropertyBase* p = property( n );
153 return ( p && p->fromString( v ) ) ? StatusCode::SUCCESS : StatusCode::FAILURE;
154 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
Gaudi::Details::PropertyBase::fromString
virtual StatusCode fromString(const std::string &value)=0
string -> value
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:210
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
PropertyMgr::property
Gaudi::Details::PropertyBase * property(const std::string &name) const
Definition: PropertyMgr.cpp:109
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## Member Data Documentation

## ◆ m_pOuter

IInterface* PropertyMgr::m_pOuter
| private

Interface hub reference (ApplicationMgr)

Definition at line 143 of file PropertyMgr.h.

## ◆ m_properties

Properties PropertyMgr::m_properties
| private

Collection of all declared properties.

Definition at line 137 of file PropertyMgr.h.

## ◆ m_remoteProperties

RemoteProperties PropertyMgr::m_remoteProperties
| private

Collection of all declared remote properties.

Definition at line 139 of file PropertyMgr.h.

## ◆ m_todelete

std::vector<std::unique_ptr<Gaudi::Details::PropertyBase> > PropertyMgr::m_todelete
| private

Properties to be deleted.

Definition at line 141 of file PropertyMgr.h.

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

- GaudiKernel/GaudiKernel/PropertyMgr.h
- GaudiKernel/src/Lib/PropertyMgr.cpp