#include <GaudiKernel/PropertyMgr.h>
Inheritance diagram for PropertyMgr:
Public Types | |
SUCCESS = 1 | |
Normal successful completion. | |
NO_INTERFACE | |
Requested interface is not available. | |
VERSMISMATCH | |
Requested interface version is incompatible. | |
LAST_ERROR | |
Last error. | |
enum | Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR } |
Return status. More... | |
Public Member Functions | |
PropertyMgr (IInterface *iface=0) | |
contructor from the interface | |
PropertyMgr (const PropertyMgr &) | |
virtual | ~PropertyMgr () |
virtual destructor | |
PropertyMgr & | operator= (const PropertyMgr &) |
template<class TYPE> | |
Property * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none") |
Declare a property (templated). | |
template<class TYPE> | |
Property * | declareProperty (const std::string &name, SimpleProperty< TYPE > &prop, const std::string &doc="none") |
Declare a property (specialization). | |
template<class TYPE> | |
Property * | declareProperty (const std::string &name, SimplePropertyRef< TYPE > &prop, const std::string &doc="none") |
Declare a property (specialization). | |
template<class TYPE> | |
Property * | declareProperty (const std::string &name, ToolHandle< TYPE > &ref, const std::string &doc="none") |
Declare a property (specialization). | |
template<class TYPE> | |
Property * | declareProperty (const std::string &name, ServiceHandle< TYPE > &ref, const std::string &doc="none") |
Declare a property (specialization). | |
template<class TYPE> | |
Property * | declareProperty (const std::string &name, ToolHandleArray< TYPE > &ref, const std::string &doc="none") |
Declare a property (specialization). | |
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") |
Declare a remote property. | |
StatusCode | setProperty (const Property &p) |
set the property form another property | |
StatusCode | setProperty (const std::string &s) |
set the property from the property formatted string | |
StatusCode | setProperty (const std::string &n, const std::string &v) |
set the property from the property fomr name and the value | |
StatusCode | getProperty (Property *p) const |
get the property | |
const Property & | getProperty (const std::string &name) const |
get the propery by name | |
StatusCode | getProperty (const std::string &n, std::string &v) const |
convert the property to the string | |
const std::vector< Property * > & | getProperties () const |
get all properties | |
StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface) |
Query interfaces of Interface. | |
unsigned long | addRef () |
Increment the reference count of Interface instance. | |
unsigned long | release () |
Release Interface instance. | |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
Retrieve interface ID. | |
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 | |
Private Attributes | |
Properties | m_properties |
Collection of all declared properties. | |
RemoteProperties | m_remoteProperties |
Collection of all declared remote properties. | |
Properties | m_todelete |
Properties to be deleted. | |
std::vector< bool > | m_isOwned |
Flag to decide to delete or not a propertyRef. | |
IInterface * | m_pOuter |
Interface hub reference (ApplicationMgr). | |
unsigned long | m_refcount |
Reference counter. |
This class is used by algorithms and services for helping to manage its own set of properties. It implements the IProperty interface.
David Quarrie
Definition at line 37 of file PropertyMgr.h.
typedef std::vector<Property*> PropertyMgr::Properties [private] |
Definition at line 148 of file PropertyMgr.h.
typedef std::pair<std::string, std::pair<IProperty*, std::string> > PropertyMgr::RemProperty [private] |
Definition at line 150 of file PropertyMgr.h.
typedef std::vector<RemProperty> PropertyMgr::RemoteProperties [private] |
Definition at line 151 of file PropertyMgr.h.
enum IInterface::Status [inherited] |
Return status.
SUCCESS | Normal successful completion. |
NO_INTERFACE | Requested interface is not available. |
VERSMISMATCH | Requested interface version is incompatible. |
LAST_ERROR | Last error. |
Reimplemented in IConversionSvc, IConverter, and IDataProviderSvc.
Definition at line 113 of file IInterface.h.
00113 { 00115 SUCCESS = 1, 00117 NO_INTERFACE, 00119 VERSMISMATCH, 00121 LAST_ERROR 00122 };
PropertyMgr::PropertyMgr | ( | IInterface * | iface = 0 |
) |
contructor from the interface
PropertyMgr::PropertyMgr | ( | const PropertyMgr & | ) |
virtual PropertyMgr::~PropertyMgr | ( | ) | [virtual] |
virtual destructor
PropertyMgr& PropertyMgr::operator= | ( | const PropertyMgr & | ) |
Property * PropertyMgr::declareProperty | ( | const std::string & | name, | |
TYPE & | value, | |||
const std::string & | doc = "none" | |||
) | [inline] |
Declare a property (templated).
Definition at line 174 of file PropertyMgr.h.
00177 { 00178 Property* p = new SimplePropertyRef<TYPE> ( name , value ) ; 00179 // 00180 p->setDocumentation( doc ); 00181 m_properties .push_back( p ) ; 00182 m_todelete .push_back( p ) ; 00183 // 00184 return p ; 00185 }
Property * PropertyMgr::declareProperty | ( | const std::string & | name, | |
SimpleProperty< TYPE > & | prop, | |||
const std::string & | doc = "none" | |||
) | [inline] |
Declare a property (specialization).
Definition at line 192 of file PropertyMgr.h.
00195 { 00196 Property* p = &prop ; 00197 // 00198 p -> setName ( name ) ; 00199 p -> setDocumentation ( doc ) ; 00200 m_properties.push_back ( p ) ; 00201 // 00202 return p ; 00203 }
Property * PropertyMgr::declareProperty | ( | const std::string & | name, | |
SimplePropertyRef< TYPE > & | prop, | |||
const std::string & | doc = "none" | |||
) | [inline] |
Declare a property (specialization).
Definition at line 210 of file PropertyMgr.h.
00213 { 00214 Property* p = &prop ; 00215 // 00216 p -> setName ( name ) ; 00217 p -> setDocumentation ( doc ) ; 00218 m_properties.push_back ( p ) ; 00219 // 00220 return p ; 00221 }
Property * PropertyMgr::declareProperty | ( | const std::string & | name, | |
ToolHandle< TYPE > & | ref, | |||
const std::string & | doc = "none" | |||
) | [inline] |
Declare a property (specialization).
Definition at line 228 of file PropertyMgr.h.
00231 { 00232 Property* p = new GaudiHandleProperty( name, ref ); 00233 // 00234 p -> setDocumentation ( doc ) ; 00235 m_properties . push_back ( p ) ; 00236 m_todelete . push_back ( p ) ; 00237 // 00238 return p ; 00239 }
Property * PropertyMgr::declareProperty | ( | const std::string & | name, | |
ServiceHandle< TYPE > & | ref, | |||
const std::string & | doc = "none" | |||
) | [inline] |
Declare a property (specialization).
Definition at line 244 of file PropertyMgr.h.
00247 { 00248 Property* p = new GaudiHandleProperty( name, ref ); 00249 // 00250 p -> setDocumentation ( doc ) ; 00251 m_properties . push_back ( p ) ; 00252 m_todelete . push_back ( p ) ; 00253 // 00254 return p ; 00255 }
Property * PropertyMgr::declareProperty | ( | const std::string & | name, | |
ToolHandleArray< TYPE > & | ref, | |||
const std::string & | doc = "none" | |||
) | [inline] |
Declare a property (specialization).
Definition at line 260 of file PropertyMgr.h.
00263 { 00264 Property* p = new GaudiHandleArrayProperty( name, ref ); 00265 // 00266 p -> setDocumentation ( doc ) ; 00267 m_properties . push_back ( p ) ; 00268 m_todelete . push_back ( p ) ; 00269 // 00270 return p ; 00271 }
Property* PropertyMgr::declareRemoteProperty | ( | const std::string & | name, | |
IProperty * | rsvc, | |||
const std::string & | rname = "" | |||
) |
Declare a remote property.
StatusCode PropertyMgr::setProperty | ( | const Property & | p | ) | [virtual] |
StatusCode PropertyMgr::setProperty | ( | const std::string & | s | ) | [virtual] |
StatusCode PropertyMgr::setProperty | ( | const std::string & | n, | |
const std::string & | v | |||
) | [virtual] |
StatusCode PropertyMgr::getProperty | ( | Property * | p | ) | const [virtual] |
const Property& PropertyMgr::getProperty | ( | const std::string & | name | ) | const [virtual] |
StatusCode PropertyMgr::getProperty | ( | const std::string & | n, | |
std::string & | v | |||
) | const [virtual] |
const std::vector<Property*>& PropertyMgr::getProperties | ( | ) | const [virtual] |
StatusCode PropertyMgr::queryInterface | ( | const InterfaceID & | riid, | |
void ** | ppvInterface | |||
) | [virtual] |
Query interfaces of Interface.
riid | ID of Interface to be retrieved | |
ppvInterface | Pointer to Location for interface pointer |
Implements IInterface.
unsigned long PropertyMgr::addRef | ( | ) | [virtual] |
unsigned long PropertyMgr::release | ( | ) | [virtual] |
Property* PropertyMgr::property | ( | const std::string & | name | ) | const [protected] |
Property* PropertyMgr::property | ( | const std::string & | name, | |
const std::vector< Property * > & | props | |||
) | const [private] |
get the property by name form the proposed list
static const InterfaceID& IProperty::interfaceID | ( | ) | [inline, static, inherited] |
Retrieve interface ID.
Reimplemented from IInterface.
Definition at line 28 of file IProperty.h.
00028 { return IID_IProperty; }
Properties PropertyMgr::m_properties [private] |
Properties PropertyMgr::m_todelete [private] |
std::vector<bool> PropertyMgr::m_isOwned [private] |
IInterface* PropertyMgr::m_pOuter [private] |
unsigned long PropertyMgr::m_refcount [private] |