| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

PropertyMgr Class Reference

Property manager helper class. More...

#include <GaudiKernel/PropertyMgr.h>

Inheritance diagram for PropertyMgr:

[legend]
Collaboration diagram for PropertyMgr:
[legend]
List of all members.

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
PropertyMgroperator= (const PropertyMgr &)
template<class TYPE>
PropertydeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Declare a property (templated).
template<class TYPE>
PropertydeclareProperty (const std::string &name, SimpleProperty< TYPE > &prop, const std::string &doc="none")
 Declare a property (specialization).
template<class TYPE>
PropertydeclareProperty (const std::string &name, SimplePropertyRef< TYPE > &prop, const std::string &doc="none")
 Declare a property (specialization).
template<class TYPE>
PropertydeclareProperty (const std::string &name, ToolHandle< TYPE > &ref, const std::string &doc="none")
 Declare a property (specialization).
template<class TYPE>
PropertydeclareProperty (const std::string &name, ServiceHandle< TYPE > &ref, const std::string &doc="none")
 Declare a property (specialization).
template<class TYPE>
PropertydeclareProperty (const std::string &name, ToolHandleArray< TYPE > &ref, const std::string &doc="none")
 Declare a property (specialization).
PropertydeclareRemoteProperty (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 PropertygetProperty (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 InterfaceIDinterfaceID ()
 Retrieve interface ID.

Protected Member Functions

Propertyproperty (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< RemPropertyRemoteProperties

Private Member Functions

Propertyproperty (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.
IInterfacem_pOuter
 Interface hub reference (ApplicationMgr).
unsigned long m_refcount
 Reference counter.

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 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.


Member Enumeration Documentation

enum IInterface::Status [inherited]

Return status.

Enumerator:
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   };


Constructor & Destructor Documentation

PropertyMgr::PropertyMgr ( IInterface iface = 0  ) 

contructor from the interface

PropertyMgr::PropertyMgr ( const PropertyMgr  ) 

virtual PropertyMgr::~PropertyMgr (  )  [virtual]

virtual destructor


Member Function Documentation

PropertyMgr& PropertyMgr::operator= ( const PropertyMgr  ) 

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 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 }

template<class TYPE>
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 }

template<class TYPE>
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 }

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 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 }

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 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 }

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 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]

set the property form another property

See also:
IProperty

Implements IProperty.

StatusCode PropertyMgr::setProperty ( const std::string &  s  )  [virtual]

set the property from the property formatted string

See also:
IProperty

Implements IProperty.

StatusCode PropertyMgr::setProperty ( const std::string &  n,
const std::string &  v 
) [virtual]

set the property from the property fomr name and the value

See also:
IProperty

Implements IProperty.

StatusCode PropertyMgr::getProperty ( Property p  )  const [virtual]

get the property

See also:
IProperty

Implements IProperty.

const Property& PropertyMgr::getProperty ( const std::string &  name  )  const [virtual]

get the propery by name

See also:
IProperty

Implements IProperty.

StatusCode PropertyMgr::getProperty ( const std::string &  n,
std::string &  v 
) const [virtual]

convert the property to the string

See also:
IProperty

Implements IProperty.

const std::vector<Property*>& PropertyMgr::getProperties (  )  const [virtual]

get all properties

See also:
IProperty

Implements IProperty.

StatusCode PropertyMgr::queryInterface ( const InterfaceID riid,
void **  ppvInterface 
) [virtual]

Query interfaces of Interface.

Parameters:
riid ID of Interface to be retrieved
ppvInterface Pointer to Location for interface pointer

Implements IInterface.

unsigned long PropertyMgr::addRef (  )  [virtual]

Increment the reference count of Interface instance.

Implements IInterface.

unsigned long PropertyMgr::release (  )  [virtual]

Release Interface instance.

Implements IInterface.

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; }


Member Data Documentation

Properties PropertyMgr::m_properties [private]

Collection of all declared properties.

Definition at line 156 of file PropertyMgr.h.

RemoteProperties PropertyMgr::m_remoteProperties [private]

Collection of all declared remote properties.

Definition at line 158 of file PropertyMgr.h.

Properties PropertyMgr::m_todelete [private]

Properties to be deleted.

Definition at line 160 of file PropertyMgr.h.

std::vector<bool> PropertyMgr::m_isOwned [private]

Flag to decide to delete or not a propertyRef.

Definition at line 162 of file PropertyMgr.h.

IInterface* PropertyMgr::m_pOuter [private]

Interface hub reference (ApplicationMgr).

Definition at line 164 of file PropertyMgr.h.

unsigned long PropertyMgr::m_refcount [private]

Reference counter.

Definition at line 166 of file PropertyMgr.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:57:13 2011 for GaudiKernel by doxygen 1.4.7