|
Gaudi Framework, version v22r0 |
| Home | Generated: 9 Feb 2011 |
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.
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] |
Definition at line 100 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.
Activate a partition object. The name identifies the partition uniquely.
Definition at line 127 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.
00142 { 00143 STATUS sc = m_actor ? m_actor->activePartition(nam, pPartition) : NO_INTERFACE; 00144 CHECK(sc, "Cannot determine active partition."); 00145 }
| 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.
Create a partition object. The name identifies the partition uniquely.
Definition at line 107 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.
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 }
| 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::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.
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 }
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.