8 #include "GaudiKernel/IPartitionControl.h"
9 #include "GaudiKernel/Algorithm.h"
10 #include "GaudiKernel/MsgStream.h"
11 #include "GaudiKernel/IToolSvc.h"
12 #include "GaudiKernel/IAlgTool.h"
13 #include "GaudiKernel/SmartIF.h"
27 typedef const std::string&
CSTR;
57 log <<
MSG::ERROR <<
"Unable to load PartitionSwitchTool "
65 sc = m_actor->
get(m_partName, partititon);
67 log <<
MSG::ERROR <<
"Cannot access partition \""
68 << m_partName <<
"\"" <<
endmsg;
87 log <<
MSG::ERROR <<
"Cannot activate partition \""
88 << m_partName <<
"\"!" <<
endmsg;
94 <<
"." << m_toolType <<
"\" cannot be accessed!" <<
endmsg;
102 #define CHECK(x,y) if ( !x.isSuccess() ) _check(x, y); return x;
105 virtual STATUS
create(CSTR nam, CSTR typ) {
107 CHECK(sc,
"Cannot create partition: "+nam+
" of type "+typ);
112 CHECK(sc,
"Cannot create partition: "+nam+
" of type "+typ);
115 virtual STATUS
drop(CSTR nam) {
117 CHECK(sc,
"Cannot drop partition: "+nam);
122 CHECK(sc,
"Cannot drop partition by Interface.");
127 CHECK(sc,
"Cannot activate partition: "+nam);
132 CHECK(sc,
"Cannot activate partition by Interface.");
135 virtual STATUS
get(CSTR nam,
IInterface*& pPartition)
const {
137 CHECK(sc,
"Cannot get partition "+nam);
142 CHECK(sc,
"Cannot determine active partition.");
virtual STATUS execute()
Execute procedure.
Definition of the MsgStream class used to transmit messages.
Small smart pointer class with automatic reference counting for IInterface.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
virtual StatusCode activePartition(std::string &name, IInterface *&pPartition) const =0
Access the active partition object.
virtual STATUS activePartition(std::string &nam, IInterface *&pPartition) const
Access the active partition object.
unsigned long getCode() const
Get the status code by value.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
bool isSuccess() const
Test for a status code of SUCCESS.
virtual STATUS finalize()
Finalize.
virtual STATUS initialize()
Initialize.
virtual StatusCode create(const std::string &name, const std::string &type)=0
Create a partition object. The name identifies the partition uniquely.
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
virtual STATUS activate(CSTR nam)
Activate a partition object. The name identifies the partition uniquely.
virtual STATUS drop(CSTR nam)
Drop a partition object. The name identifies the partition uniquely.
bool isFailure() const
Test for a status code of FAILURE.
SmartIF< IToolSvc > & toolSvc() const
The standard ToolSvc service, Return a pointer to the service if present.
PartitionSwitchAlg(CSTR name, ISvcLocator *pSvcLocator)
Standard algorithm constructor.
std::string m_partName
Job option to set the requested partition name.
virtual ~PartitionSwitchAlg()
Standard Destructor.
#define DECLARE_COMPONENT(type)
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
Requested interface is not available.
Base class used to extend a class implementing other interfaces.
virtual StatusCode get(const std::string &name, IInterface *&pPartition) const =0
Access a partition object. The name identifies the partition uniquely.
virtual const std::string & name() const
The identifying name of the algorithm object.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Small algorith, which switches the partition of a configurable multi-service.
virtual STATUS activate(IInterface *pPartition)
Activate a partition object.
virtual STATUS create(CSTR nam, CSTR typ)
Create a partition object. The name identifies the partition uniquely.
Create / access partitions.
void _check(STATUS sc, CSTR msg) const
IPartitionControl * m_actor
reference to Partition Controller
virtual StatusCode drop(const std::string &name)=0
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 create(CSTR nam, CSTR typ, IInterface *&pPartition)
Create a partition object. The name identifies the partition uniquely.
virtual StatusCode activate(const std::string &name)=0
Activate a partition object. The name identifies the partition uniquely.
std::string m_toolType
Job option to set the tool manipulating the multi-service name.