|
Gaudi Framework, version v23r2 |
| Home | Generated: Thu Jun 28 2012 |
Small algorith, which switches the partition of a configurable multi-service. More...


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 | |
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.
Definition at line 26 of file PartitionSwitchAlg.cpp.
typedef const std::string& PartitionSwitchAlg::CSTR [private] |
Definition at line 29 of file PartitionSwitchAlg.cpp.
typedef StatusCode PartitionSwitchAlg::STATUS [private] |
Definition at line 28 of file PartitionSwitchAlg.cpp.
| PartitionSwitchAlg::PartitionSwitchAlg | ( | CSTR | name, |
| ISvcLocator * | pSvcLocator | ||
| ) | [inline] |
Standard algorithm constructor.
Definition at line 43 of file PartitionSwitchAlg.cpp.
: base_class(name, pSvcLocator), m_actor(0) { declareProperty("Partition", m_partName); declareProperty("Tool", m_toolType="PartitionSwitchTool"); }
| virtual PartitionSwitchAlg::~PartitionSwitchAlg | ( | ) | [inline, virtual] |
Activate a partition object. The name identifies the partition uniquely.
Definition at line 127 of file PartitionSwitchAlg.cpp.
| virtual STATUS PartitionSwitchAlg::activate | ( | IInterface * | pPartition ) | [inline, virtual] |
Activate a partition object.
Implements IPartitionControl.
Definition at line 132 of file PartitionSwitchAlg.cpp.
| 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.
{
STATUS sc = m_actor ? m_actor->activePartition(nam, pPartition) : NO_INTERFACE;
CHECK(sc, "Cannot determine active partition.");
}
Create a partition object. The name identifies the partition uniquely.
Definition at line 107 of file PartitionSwitchAlg.cpp.
| 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.
| 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.
Drop a partition object. The name identifies the partition uniquely.
Definition at line 117 of file PartitionSwitchAlg.cpp.
| virtual STATUS PartitionSwitchAlg::execute | ( | ) | [inline, virtual] |
Execute procedure.
Definition at line 84 of file PartitionSwitchAlg.cpp.
{
if ( m_actor ) {
STATUS sc = m_actor->activate(m_partName);
if ( !sc.isSuccess() ) {
MsgStream log(msgSvc(), name());
log << MSG::ERROR << "Cannot activate partition \""
<< m_partName << "\"!" << endmsg;
}
return sc;
}
MsgStream log(msgSvc(), name());
log << MSG::ERROR << "The partition control tool \"" << name()
<< "." << m_toolType << "\" cannot be accessed!" << endmsg;
return STATUS::FAILURE;
}
| virtual STATUS PartitionSwitchAlg::finalize | ( | ) | [inline, virtual] |
Finalize.
Reimplemented from Algorithm.
Definition at line 76 of file PartitionSwitchAlg.cpp.
{
SmartIF<IAlgTool> tool(m_actor);
if ( tool ) toolSvc()->releaseTool(tool);
m_actor = 0;
return STATUS::SUCCESS;
}
| 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.
| 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.
{
MsgStream log(msgSvc(), name());
SmartIF<IAlgTool> tool(m_actor);
STATUS sc = toolSvc()->retrieveTool(m_toolType,m_actor,this);
if ( sc.isFailure() ) {
log << MSG::ERROR << "Unable to load PartitionSwitchTool "
<< m_toolType << endmsg;
return sc;
}
if ( tool ) toolSvc()->releaseTool(tool);
IInterface* partititon = 0;
sc = m_actor->get(m_partName, partititon);
if ( !sc.isSuccess() ) {
log << MSG::ERROR << "Cannot access partition \""
<< m_partName << "\"" << endmsg;
}
return sc;
}
IPartitionControl* PartitionSwitchAlg::m_actor [private] |
reference to Partition Controller
Definition at line 38 of file PartitionSwitchAlg.cpp.
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.