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

In This Package:

IPartitionControl Class Reference

Create / access partitions. More...

#include <GaudiKernel/IPartitionControl.h>

Inheritance diagram for IPartitionControl:

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

Public Types

 PARTITION_NOT_PRESENT = 2
 PARTITION_EXISTS = 4
 NO_ACTIVE_PARTITION = 6
enum  { PARTITION_NOT_PRESENT = 2, PARTITION_EXISTS = 4, NO_ACTIVE_PARTITION = 6 }
 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

virtual StatusCode create (const std::string &name, const std::string &type)=0
 Create a new partition.
virtual StatusCode create (const std::string &name, const std::string &type, IInterface *&pPartition)=0
 Create a new partition.
virtual StatusCode drop (const std::string &name)=0
 Remove a partition object.
virtual StatusCode drop (IInterface *pPartition)=0
 Remove a partition object.
virtual StatusCode activate (const std::string &name)=0
 Access an existing partition object.
virtual StatusCode activate (IInterface *pPartition)=0
 Access an existing partition object.
virtual StatusCode get (const std::string &name, IInterface *&pPartition) const =0
 Access an existing partition object.
virtual StatusCode activePartition (std::string &name, IInterface *&pPartition) const =0
 Access the active partition object.
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)=0
 Query interfaces of Interface.
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance.
virtual unsigned long release ()=0
 Release Interface instance.

Static Public Member Functions

static const InterfaceIDinterfaceID ()
 Retrieve interface ID.

Detailed Description

Create / access partitions.

Partitioning is used to switch between different instances of multi-services like it is used e.g. in the event buffer tampering.

Example code: =============

Switch between buffers for data processing. Use this technique to populate e.g. different datastores in order to later compare the different results.

SmartIF<IPartitionControl> partCtrl(eventSvc()); if ( partCtrl.isValid() ) { if ( partCtrl.activate("Partition_1").isSuccess() ) { SmartDataPtr mcparts(eventSvc(), "MC/Particles"); .... work with particles from buffer "Partition 1" all data registered by code here will go to "Partition 2" } if ( partCtrl.activate("Partition_2").isSuccess() ) { SmartDataPtr mcparts(eventSvc(), "MC/Particles"); .... work with particles from buffer "Partition 2" they are NOT they same as those in buffer 1 all data registered by code here will go to "Partition 2" } }

The access to the underlying service is also possible.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Be careful: This usage MAY NOT MODIFY e.g. the datastore by adding additional objects! This should solely by used for analysis after buffer tampering. In particular with "data on demand" this can easily have unexpected results.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

SmartIF<IPartitionControl> partCtrl(eventSvc()); if ( partCtrl ) { IInterface* ptr = 0; if ( partCtrl->get("Partition 1", ptr).isSuccess() ) { SmartIF<IDataProviderSvc> partition(ptr); // Now we can work directly with this partition // There is no additional dispathing in the "eventSvc()". SmartDataPtr mcparts(partition, "MC/Particles"); if ( mcparts ) { } } }

Author:
Markus Frank
Version:
1.0

Definition at line 69 of file IPartitionControl.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
PARTITION_NOT_PRESENT 
PARTITION_EXISTS 
NO_ACTIVE_PARTITION 

Definition at line 181 of file IPartitionControl.h.

00181        {  PARTITION_NOT_PRESENT = 2,
00182           PARTITION_EXISTS = 4,
00183           NO_ACTIVE_PARTITION = 6
00184   };

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


Member Function Documentation

static const InterfaceID& IPartitionControl::interfaceID (  )  [inline, static]

Retrieve interface ID.

Reimplemented from IInterface.

Definition at line 73 of file IPartitionControl.h.

00073 { return IID_IPartitionControl; }

virtual StatusCode IPartitionControl::create ( const std::string &  name,
const std::string &  type 
) [pure virtual]

Create a new partition.

If the partition exists already the existing object is returned. In this event the return code is PARTITION_EXISTS. The partition type typically contains all the information necessary to access the corresponding service, typically a pair "<service-type>/<service name>"

Parameters:
name [IN] Partition name
type [IN] Partition type
Returns:
Status code indicating failure or success.

virtual StatusCode IPartitionControl::create ( const std::string &  name,
const std::string &  type,
IInterface *&  pPartition 
) [pure virtual]

Create a new partition.

If the partition exists already the existing object is returned. In this event the return code is PARTITION_EXISTS. The partition type typically contains all the information necessary to access the corresponding service, typically a pair "<service-type>/<service name>"

Parameters:
name [IN] Partition name
type [IN] Partition type
pPartition [OUT] Reference to the created/existing partition
Returns:
Status code indicating failure or success.

virtual StatusCode IPartitionControl::drop ( const std::string &  name  )  [pure virtual]

Remove a partition object.

If the partition object does not exists, the return code is PARTITION_NOT_PRESENT. The partition may not be used anymore after this call.

Parameters:
name [IN] Partition name
Returns:
Status code indicating failure or success.

virtual StatusCode IPartitionControl::drop ( IInterface pPartition  )  [pure virtual]

Remove a partition object.

If the partition object does not exists, the return code is PARTITION_NOT_PRESENT. The partition may not be used anymore after this call. If the interface pointer is invalid, IInterface::NO_INTERFACE is returned.

Parameters:
pPartition [IN] Reference to existing partition
Returns:
Status code indicating failure or success.

virtual StatusCode IPartitionControl::activate ( const std::string &  name  )  [pure virtual]

Access an existing partition object.

Preferred call. The activation of a partition does not change the state of the partition. It only means that any call issued to the corresponding multi-service will be redirected to the this partition - typically a service implementing the same interfaces as the multi-service.

Parameters:
name [IN] Partition name
Returns:
Status code indicating failure or success.

virtual StatusCode IPartitionControl::activate ( IInterface pPartition  )  [pure virtual]

Access an existing partition object.

The activation of a partition does not change the state of the partition. It only means that any call issued to the corresponding multi-service will be redirected to the this partition - typically a service implementing the same interfaces as the multi-service.

If the interface pointer is invalid, IInterface::NO_INTERFACE is returned.

Parameters:
pPartition [IN] Pointer to the partition.
Returns:
Status code indicating failure or success.

virtual StatusCode IPartitionControl::get ( const std::string &  name,
IInterface *&  pPartition 
) const [pure virtual]

Access an existing partition object.

Parameters:
name [IN] Partition name
pPartition [IN] Location to store the pointer to the partition.
Returns:
Status code indicating failure or success.

virtual StatusCode IPartitionControl::activePartition ( std::string &  name,
IInterface *&  pPartition 
) const [pure virtual]

Access the active partition object.

Parameters:
name [OUT] Partition name
pPartition [OUT] Location to store the pointer to the partition.
Returns:
Status code indicating failure or success.

virtual StatusCode IInterface::queryInterface ( const InterfaceID riid,
void **  ppvInterface 
) [pure virtual, inherited]

Query interfaces of Interface.

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

Implemented in Algorithm, AlgTool, Auditor, ConversionSvc, Converter, DataSvc, EventSelectorDataStream, MinimalEventLoopMgr, PropertyMgr, SelectStatement, and Service.

virtual unsigned long IInterface::addRef (  )  [pure virtual, inherited]

Increment the reference count of Interface instance.

Implemented in Algorithm, AlgTool, Auditor, Converter, EventSelectorDataStream, IFactory, PropertyMgr, SelectStatement, and Service.

virtual unsigned long IInterface::release (  )  [pure virtual, inherited]

Release Interface instance.

Implemented in Algorithm, AlgTool, Auditor, Converter, EventSelectorDataStream, IFactory, PropertyMgr, SelectStatement, and Service.


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:10 2011 for GaudiKernel by doxygen 1.4.7