56 error() <<
"Unable to load PartitionSwitchTool "
64 sc = m_actor->
get(m_partName, partititon);
66 error() <<
"Cannot access partition \""
67 << m_partName <<
"\"" <<
endmsg;
85 error() <<
"Cannot activate partition \""
86 << m_partName <<
"\"!" <<
endmsg;
90 error() <<
"The partition control tool \"" <<
name()
91 <<
"." << m_toolType <<
"\" cannot be accessed!" <<
endmsg;
99 template <
typename...FArgs,
typename...Args>
101 return m_actor ? (m_actor->*
fun)(std::forward<Args>(
args)...) : NO_INTERFACE;
103 template <
typename...FArgs,
typename...Args>
105 return m_actor ? (m_actor->*
fun)(std::forward<Args>(
args)...) : NO_INTERFACE;
111 return sc.isSuccess() ?
sc :
log_(
sc,
"Cannot create partition: "+nam+
" of type "+typ);
116 return sc.isSuccess() ?
sc :
log_(
sc,
"Cannot create partition: "+nam+
" of type "+typ);
121 return sc.isSuccess() ?
sc :
log_(
sc,
"Cannot drop partition: "+nam);
126 return sc.isSuccess() ?
sc :
log_(
sc,
"Cannot drop partition by Interface.");
131 return sc.isSuccess() ?
sc :
log_(
sc,
"Cannot activate partition: "+nam);
136 return sc.isSuccess() ?
sc :
log_(
sc,
"Cannot activate partition by Interface.");
141 return sc.isSuccess() ?
sc :
log_(
sc,
"Cannot get partition "+nam);
146 return sc.isSuccess() ?
sc :
log_(
sc,
"Cannot determine active partition.");
StatusCode fwd_(StatusCode(IPartitionControl::*fun)(FArgs...) const, Args &&...args) const
Small smart pointer class with automatic reference counting for IInterface.
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
STATUS initialize() override
Initialize.
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.
unsigned long getCode() const
Get the status code by value.
STATUS drop(IInterface *pPartition) override
Drop a partition object. The name identifies the partition uniquely.
StatusCode log_(StatusCode sc, const std::string &msg) const
bool isSuccess() const
Test for a status code of SUCCESS.
virtual StatusCode create(const std::string &name, const std::string &type)=0
Create a partition object. The name identifies the partition uniquely.
STATUS finalize() override
Finalize.
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
StatusCode fwd_(StatusCode(IPartitionControl::*fun)(FArgs...), Args &&...args)
bool isFailure() const
Test for a status code of FAILURE.
#define DECLARE_COMPONENT(type)
SmartIF< IToolSvc > & toolSvc() const
The standard ToolSvc service, Return a pointer to the service if present.
const std::string & name() const override
The identifying name of the algorithm object.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
~PartitionSwitchAlg() override=default
Standard Destructor.
STATUS drop(CSTR nam) override
Drop a partition object. The name identifies the partition uniquely.
std::string m_partName
Job option to set the requested partition name.
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
virtual StatusCode get(const std::string &name, IInterface *&pPartition) const =0
Access a partition object. The name identifies the partition uniquely.
PartitionSwitchAlg(const std::string &name, ISvcLocator *pSvcLocator)
Standard algorithm constructor.
STATUS create(CSTR nam, CSTR typ, IInterface *&pPartition) override
Create a partition object. The name identifies the partition uniquely.
Small algorithm which switches the partition of a configurable multi-service.
STATUS activate(IInterface *pPartition) override
Activate a partition object.
Create / access partitions.
Base class used to extend a class implementing other interfaces.
double fun(const std::vector< double > &x)
STATUS create(CSTR nam, CSTR typ) override
Create a partition object. The name identifies the partition uniquely.
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 StatusCode activate(const std::string &name)=0
Activate a partition object. The name identifies the partition uniquely.
STATUS activate(CSTR nam) override
Activate a partition object. The name identifies the partition uniquely.
STATUS activePartition(std::string &nam, IInterface *&pPartition) const override
Access the active partition object.
std::string m_toolType
Job option to set the tool manipulating the multi-service name.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
STATUS execute() override
Execute procedure.