| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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
| ~PropertyMgr () override=default
| virtual destructor More...
template<class TYPE >
Property * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Declare a property (templated) More...
template<class TYPE >
Property * | declareProperty (const std::string &name, SimpleProperty< TYPE > &prop, const std::string &doc="none")
| Declare a property (specialization) More...
template<class TYPE >
Property * | declareProperty (const std::string &name, SimplePropertyRef< TYPE > &prop, const std::string &doc="none")
| Declare a property (specialization) More...
template<class TYPE >
Property * | declareProperty (const std::string &name, ToolHandle< TYPE > &ref, const std::string &doc="none")
| Declare a property (specialization) More...
template<class TYPE >
Property * | declareProperty (const std::string &name, ServiceHandle< TYPE > &ref, const std::string &doc="none")
| Declare a property (specialization) More...
template<class TYPE >
Property * | declareProperty (const std::string &name, ToolHandleArray< TYPE > &ref, const std::string &doc="none")
| Declare a property (specialization) More...
template<class TYPE >
Property * | declareProperty (const std::string &name, ServiceHandleArray< TYPE > &ref, const std::string &doc="none")
| Declare a property (specialization) More...
template<class TYPE >
Property * | declareProperty (const std::string &name, DataObjectHandle< TYPE > &ref, const std::string &doc="none")
| Declare a property (specialization) More...
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Property &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 (Property *p) const override
| get the property More...
const Property & | 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< Property * > & | 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...
| ~implements () override=default
| Virtual destructor. 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...
Public Member Functions inherited from extend_interfaces< Interfaces...>
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Protected Member Functions
Property * | property (const std::string &name) const

## Private Types
typedef std::vector< Property * > | Properties
typedef std::pair< std::string, std::pair< IProperty *, std::string > > | RemProperty
typedef std::vector< RemProperty > | RemoteProperties

## Private Member Functions
Property * | property (const std::string &name, const std::vector< Property * > &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< Property > > | 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

Definition at line 37 of file PropertyMgr.h.

## Member Typedef Documentation

typedef std::vector<Property*> PropertyMgr::Properties
| private

Definition at line 166 of file PropertyMgr.h.

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

Definition at line 169 of file PropertyMgr.h.

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

Definition at line 168 of file PropertyMgr.h.

## Constructor & Destructor Documentation

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

constructor from the interface

Definition at line 52 of file PropertyMgr.cpp.

53 : m_pOuter ( iface )
54 {
55 addRef(); // initial reference count set to 1
56 }
PropertyMgr::m_pOuter
IInterface * m_pOuter
Interface hub reference (ApplicationMgr)
Definition: PropertyMgr.h:178
implements< IProperty >::addRef
unsigned long addRef() override
Reference Interface instance.
Definition: implements.h:44

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

PropertyMgr::~PropertyMgr | ( |  | ) |
| override default

virtual destructor

## Member Function Documentation

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 207 of file PropertyMgr.cpp.

207 {
208 if (UNLIKELY(hasProperty(name))) {
209 auto owner = SmartIF<INamedInterface>( m_pOuter );
210 auto msgSvc = Gaudi::svcLocator()->service<IMessageSvc>("MessageSvc");
211 if (!msgSvc) { std::cerr<< "error: cannot get MessageSvc!" << std::endl; }
212 MsgStream log(msgSvc, owner ? owner->name() : "PropertyMgr" );
213 log << MSG::WARNING
214 << "duplicated property name '" << name
215 << "', see https://its.cern.ch/jira/browse/GAUDI-1023"<< endmsg;
216 }
217 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
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:178
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
std::endl
T endl(T...args)
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
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:78
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
IMessageSvc
The IMessage is the interface implemented by the message service.
Definition: IMessageSvc.h:57
PropertyMgr::hasProperty
bool hasProperty(const std::string &name) const override
Return true if we have a property with the given name.
Definition: PropertyMgr.cpp:201
MSG::WARNING
Definition: IMessageSvc.h:20
std::cerr
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
ForwardSchedulerSimpleTest.msgSvc
tuple msgSvc
Definition: ForwardSchedulerSimpleTest.py:112
template<class TYPE >

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

Declare a property (templated)

Definition at line 186 of file PropertyMgr.h.

189 {
190 assertUniqueName(name);
191 m_todelete.emplace_back( new SimplePropertyRef<TYPE> ( name , value ) );
192 Property* p = m_todelete.back().get();
193 //
194 p->setDocumentation( doc );
195 m_properties .push_back( p ) ;
196 //
197 return p ;
198 }
SimplePropertyRef
SimplePropertyRef templated class.
Definition: HistoProperty.h:14
Property::setDocumentation
void setDocumentation(std::string documentation)
set the documentation string
Definition: Property.h:94
std::vector::push_back
T push_back(T...args)
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:172
dump_component_properties.value
list value
Definition: dump_component_properties.py:12
std::unique_ptr::get
T get(T...args)
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
std::vector::back
T back(T...args)
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:207
PropertyMgr::m_todelete
std::vector< std::unique_ptr< Property > > m_todelete
Properties to be deleted.
Definition: PropertyMgr.h:176
std::vector::emplace_back
T emplace_back(T...args)
template<class TYPE >

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

Declare a property (specialization)

Declare a property (templated)

Definition at line 205 of file PropertyMgr.h.

208 {
209 assertUniqueName(name);
210 Property* p = &prop ;
211 //
212 p -> setName ( name ) ;
213 p -> setDocumentation ( doc ) ;
214 m_properties.push_back ( p ) ;
215 //
216 return p ;
217 }
std::vector::push_back
T push_back(T...args)
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:172
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
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:207
template<class TYPE >

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

Declare a property (specialization)

Declare a property (templated)

Definition at line 224 of file PropertyMgr.h.

227 {
228 assertUniqueName(name);
229 Property* p = &prop ;
230 //
231 p -> setName ( name ) ;
232 p -> setDocumentation ( doc ) ;
233 m_properties.push_back ( p ) ;
234 //
235 return p ;
236 }
std::vector::push_back
T push_back(T...args)
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:172
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
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:207
template<class TYPE >

Property * PropertyMgr::declareProperty | ( | const std::string & | name,
|  | ToolHandle< TYPE > & | ref,
|  | const std::string & | doc = `"none"`
| ) |  |
| inline

Declare a property (specialization)

Definition at line 243 of file PropertyMgr.h.

246 {
247 assertUniqueName(name);
248 m_todelete . emplace_back ( new GaudiHandleProperty( name, ref ) );
249 Property* p = m_todelete.back().get();
250 //
251 p -> setDocumentation ( doc ) ;
252 m_properties . push_back ( p ) ;
253 //
254 return p ;
255 }
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:172
std::unique_ptr::get
T get(T...args)
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
std::vector::back
T back(T...args)
GaudiPython.Bindings.GaudiHandleProperty
GaudiHandleProperty
Definition: Bindings.py:48
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:207
PropertyMgr::m_todelete
std::vector< std::unique_ptr< Property > > m_todelete
Properties to be deleted.
Definition: PropertyMgr.h:176
template<class TYPE >

Property * PropertyMgr::declareProperty | ( | const std::string & | name,
|  | ServiceHandle< TYPE > & | ref,
|  | const std::string & | doc = `"none"`
| ) |  |
| inline

Declare a property (specialization)

Definition at line 260 of file PropertyMgr.h.

263 {
264 assertUniqueName(name);
265 m_todelete . emplace_back (new GaudiHandleProperty( name, ref ));
266 Property* p = m_todelete.back().get();
267 //
268 p -> setDocumentation ( doc ) ;
269 m_properties . push_back ( p ) ;
270 //
271 return p ;
272 }
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:172
std::unique_ptr::get
T get(T...args)
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
std::vector::back
T back(T...args)
GaudiPython.Bindings.GaudiHandleProperty
GaudiHandleProperty
Definition: Bindings.py:48
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:207
PropertyMgr::m_todelete
std::vector< std::unique_ptr< Property > > m_todelete
Properties to be deleted.
Definition: PropertyMgr.h:176
template<class TYPE >

Property * PropertyMgr::declareProperty | ( | const std::string & | name,
|  | ToolHandleArray< TYPE > & | ref,
|  | const std::string & | doc = `"none"`
| ) |  |
| inline

Declare a property (specialization)

Definition at line 277 of file PropertyMgr.h.

280 {
281 assertUniqueName(name);
282 m_todelete . emplace_back ( new GaudiHandleArrayProperty( name, ref ) );
283 Property* p = m_todelete.back().get();
284 //
285 p -> setDocumentation ( doc ) ;
286 m_properties . push_back ( p ) ;
287 //
288 return p ;
289 }
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:172
GaudiPython.Bindings.GaudiHandleArrayProperty
GaudiHandleArrayProperty
Definition: Bindings.py:49
std::unique_ptr::get
T get(T...args)
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
std::vector::back
T back(T...args)
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:207
PropertyMgr::m_todelete
std::vector< std::unique_ptr< Property > > m_todelete
Properties to be deleted.
Definition: PropertyMgr.h:176
template<class TYPE >

Property * PropertyMgr::declareProperty | ( | const std::string & | name,
|  | ServiceHandleArray< TYPE > & | ref,
|  | const std::string & | doc = `"none"`
| ) |  |
| inline

Declare a property (specialization)

Definition at line 294 of file PropertyMgr.h.

297 {
298 assertUniqueName(name);
299 m_todelete . emplace_back ( new GaudiHandleArrayProperty( name, ref ) );
300 Property* p = m_todelete.back().get();
301 //
302 p -> setDocumentation ( doc ) ;
303 m_properties . push_back ( p ) ;
304 //
305 return p ;
306 }
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:172
GaudiPython.Bindings.GaudiHandleArrayProperty
GaudiHandleArrayProperty
Definition: Bindings.py:49
std::unique_ptr::get
T get(T...args)
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
std::vector::back
T back(T...args)
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:207
PropertyMgr::m_todelete
std::vector< std::unique_ptr< Property > > m_todelete
Properties to be deleted.
Definition: PropertyMgr.h:176
template<class TYPE >

Property * PropertyMgr::declareProperty | ( | const std::string & | name,
|  | DataObjectHandle< TYPE > & | ref,
|  | const std::string & | doc = `"none"`
| ) |  |
| inline

Declare a property (specialization)

Definition at line 312 of file PropertyMgr.h.

315 {
316 assertUniqueName(name);
317 Property* p = new DataObjectHandleProperty( name, ref );
318 //
319 p -> setDocumentation ( doc ) ;
320 m_properties . push_back ( p ) ;
321 //
322 return p ;
323 }
DataObjectHandleProperty
DataObjectHandleProperty.h GaudiKernel/DataObjectHandleProperty.h.
Definition: DataObjectHandleProperty.h:23
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:172
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
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:207

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

Declare a remote property.

Definition at line 61 of file PropertyMgr.cpp.

64 {
65 if ( !rsvc ) { return nullptr ; }
66 const std::string& nam = rname.empty() ? name : rname ;
67 Property* p = property ( nam , rsvc->getProperties() ) ;
68 m_remoteProperties.emplace_back ( name , std::make_pair( rsvc , nam ) ) ;
69 return p ;
70 }
std::string::empty
T empty(T...args)
IProperty::getProperties
virtual const std::vector< Property * > & getProperties() const =0
Get list of properties.
std::string
STL class.
PropertyMgr::m_remoteProperties
RemoteProperties m_remoteProperties
Collection of all declared remote properties.
Definition: PropertyMgr.h:174
std::make_pair
T make_pair(T...args)
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
PropertyMgr::property
Property * property(const std::string &name) const
Definition: PropertyMgr.cpp:85
std::vector::emplace_back
T emplace_back(T...args)

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

get all properties

See also
  IProperty

Definition at line 186 of file PropertyMgr.cpp.

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

StatusCode PropertyMgr::getProperty | ( | Property * | p | ) | const
| override

get the property

See also
  IProperty

Definition at line 144 of file PropertyMgr.cpp.

145 {
146 try
147 {
148 const Property* pp = property( p->name() ) ;
149 if ( pp && pp->load(*p) ) return StatusCode::SUCCESS; // RETURN
150 }
151 catch ( ... ) { }
152 return StatusCode::FAILURE ; // RETURN
153 }
Property::name
const std::string & name() const
property name
Definition: Property.h:45
Property::load
virtual bool load(Property &dest) const =0
export the property value to the destination
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
compareOutputFiles.pp
tuple pp
Definition: compareOutputFiles.py:417
PropertyMgr::property
Property * property(const std::string &name) const
Definition: PropertyMgr.cpp:85

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

get the property by name

See also
  IProperty

Definition at line 159 of file PropertyMgr.cpp.

160 {
161 const Property* p = property( name ) ;
162 if ( !p ) throw std::out_of_range( "Property "+name+" not found." ); // Not found
163 return *p ; // RETURN
164 }
std::out_of_range
STL class.
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
PropertyMgr::property
Property * property(const std::string &name) const
Definition: PropertyMgr.cpp:85

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

convert the property to the string

See also
  IProperty

Definition at line 171 of file PropertyMgr.cpp.

173 {
174 // get the property
175 const Property* p = property( n ) ;
176 if ( !p ) { return StatusCode::FAILURE ; }
177 // convert the value into the string
178 v = p->toString() ;
179 //
180 return StatusCode::SUCCESS ;
181 }
Property::toString
virtual std::string toString() const =0
value -> string
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
PropertyMgr::property
Property * property(const std::string &name) const
Definition: PropertyMgr.cpp:85

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 201 of file PropertyMgr.cpp.

201 {
202 return any_of(begin(m_properties), end(m_properties),
203 [&name](const Property* prop) {
204 return noCaseCmp(prop->name(), name);
205 });
206 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
Property::name
const std::string & name() const
property name
Definition: Property.h:45
begin
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:172
end
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
std::any_of
T any_of(T...args)

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

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

Definition at line 85 of file PropertyMgr.cpp.

86 {
87 // local property ?
88 Property* lp = property ( name , m_properties ) ;
89 if ( lp ) { return lp ; } // RETURN
90 // look for remote property
91 for ( const auto& it : m_remoteProperties )
92 {
93 if ( !noCaseCmp(it.first,name) ) { continue ; } // CONTINUE
94 const IProperty* p = it.second.first ;
95 if ( !p ) { continue ; } // CONTINUE
96 return property ( it.second.second , p->getProperties() ) ; // RETURN
97 }
98 return nullptr ; // RETURN
99 }
IProperty::getProperties
virtual const std::vector< Property * > & getProperties() const =0
Get list of properties.
PropertyMgr::m_properties
Properties m_properties
Collection of all declared properties.
Definition: PropertyMgr.h:172
PropertyMgr::m_remoteProperties
RemoteProperties m_remoteProperties
Collection of all declared remote properties.
Definition: PropertyMgr.h:174
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
PropertyMgr::property
Property * property(const std::string &name) const
Definition: PropertyMgr.cpp:85

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

get the property by name form the proposed list

Definition at line 75 of file PropertyMgr.cpp.

77 {
78 auto it = std::find_if( props.begin(), props.end(), PropByName{ name } ) ;
79 return ( it != props.end() ) ? *it : nullptr; // RETURN
80 }
std::vector::end
T end(T...args)
std::find_if
T find_if(T...args)
std::vector::begin
T begin(T...args)

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

Definition at line 190 of file PropertyMgr.cpp.

190 {
191 // try local interfaces
192 StatusCode sc= base_class::queryInterface(iid, pinterface);
193 if (sc.isSuccess()) return sc;
194 // fall back on the owner
195 return m_pOuter ? m_pOuter->queryInterface(iid, pinterface)
196 : sc; // FAILURE
197 }
PropertyMgr::m_pOuter
IInterface * m_pOuter
Interface hub reference (ApplicationMgr)
Definition: PropertyMgr.h:178
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
implements::queryInterface
StatusCode queryInterface(const InterfaceID &ti, void **pp) override
Implementation of IInterface::queryInterface.
Definition: implements.h:22
IInterface::queryInterface
virtual StatusCode queryInterface(const InterfaceID &ti, void **pp)=0
Set the void** to the pointer to the requested interface of the instance.

StatusCode PropertyMgr::setProperty | ( | const Property & | p | ) |
| override

set the property form another property

See also
  IProperty

Definition at line 105 of file PropertyMgr.cpp.

106 {
107 Property* pp = property( p.name() ) ;
108 try
109 { if ( pp && pp->assign(p) ) { return StatusCode::SUCCESS ; } } // RETURN
110 catch(...) { }
111 //
112 return StatusCode::FAILURE;
113 }
Property::assign
virtual bool assign(const Property &source)=0
import the property value form the source
Property::name
const std::string & name() const
property name
Definition: Property.h:45
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
compareOutputFiles.pp
tuple pp
Definition: compareOutputFiles.py:417
PropertyMgr::property
Property * property(const std::string &name) const
Definition: PropertyMgr.cpp:85

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

set the property from the property formatted string

See also
  IProperty

Definition at line 120 of file PropertyMgr.cpp.

121 {
122 std::string name ;
123 std::string value ;
124 StatusCode sc = Gaudi::Parsers::parse( name , value , i ) ;
125 if ( sc.isFailure() ) { return sc ; }
126 return setProperty ( name , value ) ;
127 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
PropertyMgr::setProperty
StatusCode setProperty(const Property &p) override
set the property form another property
Definition: PropertyMgr.cpp:105
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
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
std::string
STL class.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
dump_component_properties.value
list value
Definition: dump_component_properties.py:12
ana.i
list i
Definition: ana.py:128

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 134 of file PropertyMgr.cpp.

135 {
136 Property* p = property( n ) ;
137 return ( p && p->fromString(v) ) ? StatusCode::SUCCESS : StatusCode::FAILURE ;
138 }
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
PropertyMgr::property
Property * property(const std::string &name) const
Definition: PropertyMgr.cpp:85
Property::fromString
virtual StatusCode fromString(const std::string &value)=0
string -> value

## Member Data Documentation

IInterface* PropertyMgr::m_pOuter
| private

Interface hub reference (ApplicationMgr)

Definition at line 178 of file PropertyMgr.h.

Properties PropertyMgr::m_properties
| private

Collection of all declared properties.

Definition at line 172 of file PropertyMgr.h.

RemoteProperties PropertyMgr::m_remoteProperties
| private

Collection of all declared remote properties.

Definition at line 174 of file PropertyMgr.h.

std::vector<std::unique_ptr<Property> > PropertyMgr::m_todelete
| private

Properties to be deleted.

Definition at line 176 of file PropertyMgr.h.

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

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