| # Gaudi Framework, version v21r10p1 |

Home |  | Generated: 29 Jul 2010

# PartitionSwitchAlg Class Reference

Small algorith, which switches the partition of a configurable multi-service. More...

Inheritance diagram for PartitionSwitchAlg:

[legend]
Collaboration diagram for PartitionSwitchAlg:

[legend]

List of all members.

## Public Member Functions
| PartitionSwitchAlg (CSTR name, ISvcLocator *pSvcLocator)
| Standard algorithm constructor.
virtual | ~PartitionSwitchAlg ()
| Standard Destructor.
virtual STATUS | initialize ()
| Initialize.
virtual STATUS | finalize ()
| Finalize.
virtual STATUS | execute ()
| Execute procedure.
void | _check (STATUS sc, CSTR msg) const
virtual STATUS | create (CSTR nam, CSTR typ)
| Create a partition object. The name identifies the partition uniquely.
virtual STATUS | create (CSTR nam, CSTR typ, IInterface *&pPartition)
| Create a partition object. The name identifies the partition uniquely.
virtual STATUS | drop (CSTR nam)
| Drop a partition object. The name identifies the partition uniquely.
virtual STATUS | drop (IInterface *pPartition)
| Drop a partition object. The name identifies the partition uniquely.
virtual STATUS | activate (CSTR nam)
| Activate a partition object. The name identifies the partition uniquely.
virtual STATUS | activate (IInterface *pPartition)
| Activate a partition object.
virtual STATUS | get (CSTR nam, IInterface *&pPartition) const
| Access a partition object. The name identifies the partition uniquely.
virtual STATUS | activePartition (std::string &nam, IInterface *&pPartition) const
| Access the active partition object.
## Private Types
typedef StatusCode | STATUS
typedef const std::string & | CSTR
## Private Attributes
std::string | m_partName
| Job option to set the requested partition name.
std::string | m_toolType
| Job option to set the tool manipulating the multi-service name.
IPartitionControl * | m_actor
| reference to Partition Controller

## Detailed Description

Small algorith, which switches the partition of a configurable multi-service.

The algorithm can be part of a sequence, which allows for e.g. buffer tampering.

Author:
  : M.Frank

Version:
  : 1.0

Definition at line 26 of file PartitionSwitchAlg.cpp.

## Member Typedef Documentation

typedef StatusCode PartitionSwitchAlg::STATUS`[private]`

Definition at line 28 of file PartitionSwitchAlg.cpp.

typedef const std::string& PartitionSwitchAlg::CSTR`[private]`

Definition at line 29 of file PartitionSwitchAlg.cpp.

## Constructor & Destructor Documentation

PartitionSwitchAlg::PartitionSwitchAlg | ( | CSTR | name,
|  | ISvcLocator * | pSvcLocator |
| ) |  |  | `[inline]`

Standard algorithm constructor.

Definition at line 43 of file PartitionSwitchAlg.cpp.

    00044   : base_class(name, pSvcLocator), m_actor(0)
    00045   {
    00046     declareProperty("Partition",  m_partName);
    00047     declareProperty("Tool",       m_toolType="PartitionSwitchTool");
    00048   }

virtual PartitionSwitchAlg::~PartitionSwitchAlg | ( |  | ) | `[inline, virtual]`

Standard Destructor.

Definition at line 50 of file PartitionSwitchAlg.cpp.

    00050                                     {
    00051   }

## Member Function Documentation

virtual STATUS PartitionSwitchAlg::initialize | ( |  | ) | `[inline, virtual]`

Initialize.

Release old tool

Now check if the partition is present. If not: try to create it

Reimplemented from Algorithm.

Definition at line 54 of file PartitionSwitchAlg.cpp.

    00054                                 {
    00055     MsgStream log(msgSvc(), name());
    00056     SmartIF<IAlgTool> tool(m_actor);
    00057     STATUS sc = toolSvc()->retrieveTool(m_toolType,m_actor,this);
    00058     if ( sc.isFailure() ) {
    00059       log << MSG::ERROR << "Unable to load PartitionSwitchTool "
    00060           << m_toolType << endmsg;
    00061       return sc;
    00062     }
    00064     if ( tool ) toolSvc()->releaseTool(tool);
    00066     IInterface* partititon = 0;
    00067     sc = m_actor->get(m_partName, partititon);
    00068     if ( !sc.isSuccess() )  {
    00069       log << MSG::ERROR << "Cannot access partition \""
    00070           << m_partName << "\"" << endmsg;
    00071     }
    00072     return sc;
    00073   }

virtual STATUS PartitionSwitchAlg::finalize | ( |  | ) | `[inline, virtual]`

Finalize.

Reimplemented from Algorithm.

Definition at line 76 of file PartitionSwitchAlg.cpp.

    00076                             {
    00077     SmartIF<IAlgTool> tool(m_actor);
    00078     if ( tool ) toolSvc()->releaseTool(tool);
    00079     m_actor = 0;
    00080     return STATUS::SUCCESS;
    00081   }

virtual STATUS PartitionSwitchAlg::execute | ( |  | ) | `[inline, virtual]`

Execute procedure.

Definition at line 84 of file PartitionSwitchAlg.cpp.

    00084                               {
    00085     if ( m_actor )  {
    00086       STATUS sc = m_actor->activate(m_partName);
    00087       if ( !sc.isSuccess() )  {
    00088         MsgStream log(msgSvc(), name());
    00089         log << MSG::ERROR << "Cannot activate partition \""
    00090             << m_partName << "\"!" << endmsg;
    00091       }
    00092       return sc;
    00093     }
    00094     MsgStream log(msgSvc(), name());
    00095     log << MSG::ERROR << "The partition control tool \"" << name()
    00096         << "." << m_toolType << "\" cannot be accessed!" << endmsg;
    00097     return STATUS::FAILURE;
    00098   }

void PartitionSwitchAlg::_check | ( | STATUS | sc,
|  | CSTR | msg |
| ) |  |  | const`[inline]`

Definition at line 100 of file PartitionSwitchAlg.cpp.

    00100                                           {
    00101     MsgStream log(msgSvc(), name());
    00102     log << MSG::ERROR << msg << " Status=" << sc.getCode() << endmsg;
    00103   }

virtual STATUS PartitionSwitchAlg::create | ( | CSTR | nam,
|  | CSTR | typ |
| ) |  |  | `[inline, virtual]`

Create a partition object. The name identifies the partition uniquely.

Definition at line 107 of file PartitionSwitchAlg.cpp.

    00107                                              {
    00108     STATUS sc = m_actor ? m_actor->create(nam,typ) : NO_INTERFACE;
    00109     CHECK(sc, "Cannot create partition: "+nam+" of type "+typ);
    00110   }

virtual STATUS PartitionSwitchAlg::create | ( | CSTR | nam,
|  | CSTR | typ,
|  | IInterface *& | pPartition |
| ) |  |  | `[inline, virtual]`

Create a partition object. The name identifies the partition uniquely.

Definition at line 112 of file PartitionSwitchAlg.cpp.

    00112                                                                       {
    00113     STATUS sc = m_actor ? m_actor->create(nam,typ,pPartition) : NO_INTERFACE;
    00114     CHECK(sc, "Cannot create partition: "+nam+" of type "+typ);
    00115   }

virtual STATUS PartitionSwitchAlg::drop | ( | CSTR | nam | ) | `[inline, virtual]`

Drop a partition object. The name identifies the partition uniquely.

Definition at line 117 of file PartitionSwitchAlg.cpp.

    00117                                  {
    00118     STATUS sc = m_actor ? m_actor->drop(nam) : NO_INTERFACE;
    00119     CHECK(sc, "Cannot drop partition: "+nam);
    00120   }

virtual STATUS PartitionSwitchAlg::drop | ( | IInterface * | pPartition | ) | `[inline, virtual]`

Drop a partition object. The name identifies the partition uniquely.

Implements IPartitionControl.

Definition at line 122 of file PartitionSwitchAlg.cpp.

    00122                                                {
    00123     STATUS sc = m_actor ? m_actor->drop(pPartition) : NO_INTERFACE;
    00124     CHECK(sc, "Cannot drop partition by Interface.");
    00125   }

virtual STATUS PartitionSwitchAlg::activate | ( | CSTR | nam | ) | `[inline, virtual]`

Activate a partition object. The name identifies the partition uniquely.

Definition at line 127 of file PartitionSwitchAlg.cpp.

    00127                                      {
    00128     STATUS sc = m_actor ? m_actor->activate(nam) : NO_INTERFACE;
    00129     CHECK(sc, "Cannot activate partition: "+nam);
    00130   }

virtual STATUS PartitionSwitchAlg::activate | ( | IInterface * | pPartition | ) | `[inline, virtual]`

Activate a partition object.

Implements IPartitionControl.

Definition at line 132 of file PartitionSwitchAlg.cpp.

    00132                                                    {
    00133     STATUS sc = m_actor ? m_actor->activate(pPartition) : NO_INTERFACE;
    00134     CHECK(sc, "Cannot activate partition by Interface.");
    00135   }

virtual STATUS PartitionSwitchAlg::get | ( | CSTR | nam,
|  | IInterface *& | pPartition |
| ) |  |  | const`[inline, virtual]`

Access a partition object. The name identifies the partition uniquely.

Definition at line 137 of file PartitionSwitchAlg.cpp.

    00137                                                                {
    00138     STATUS sc = m_actor ? m_actor->get(nam, pPartition) : NO_INTERFACE;
    00139     CHECK(sc, "Cannot get partition "+nam);
    00140   }

virtual STATUS PartitionSwitchAlg::activePartition | ( | std::string & | nam,
|  | IInterface *& | pPartition |
| ) |  |  | const`[inline, virtual]`

Access the active partition object.

Implements IPartitionControl.

Definition at line 142 of file PartitionSwitchAlg.cpp.

    00142                                                                                  {
    00143     STATUS sc = m_actor ? m_actor->activePartition(nam, pPartition) : NO_INTERFACE;
    00144     CHECK(sc, "Cannot determine active partition.");
    00145   }

## Member Data Documentation

std::string PartitionSwitchAlg::m_partName`[private]`

Job option to set the requested partition name.

Definition at line 34 of file PartitionSwitchAlg.cpp.

std::string PartitionSwitchAlg::m_toolType`[private]`

Job option to set the tool manipulating the multi-service name.

Definition at line 36 of file PartitionSwitchAlg.cpp.

IPartitionControl* PartitionSwitchAlg::m_actor`[private]`

reference to Partition Controller

Definition at line 38 of file PartitionSwitchAlg.cpp.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r10p1/GaudiSvc/src/DataSvc/PartitionSwitchAlg.cpp