PartitionSwitchTool Class Reference
Inheritance diagram for PartitionSwitchTool:
Collaboration diagram for PartitionSwitchTool:

Public Member Functions

 PartitionSwitchTool (const std::string &typ, const std::string &nam, const IInterface *parent)
 Standard constructor. More...
 
 ~PartitionSwitchTool () override=default
 Standard destructor. More...
 
STATUS initialize () override
 Initialize. More...
 
STATUS finalize () override
 Finalize. More...
 
void _check (STATUS sc, CSTR msg) const
 
STATUS create (CSTR nam, CSTR typ) override
 Create a partition object. The name identifies the partition uniquely. More...
 
STATUS create (CSTR nam, CSTR typ, IInterface *&pPartition) override
 Create a partition object. The name identifies the partition uniquely. More...
 
STATUS drop (CSTR nam) override
 Drop a partition object. The name identifies the partition uniquely. More...
 
STATUS drop (IInterface *pPartition) override
 Drop a partition object. The name identifies the partition uniquely. More...
 
STATUS activate (CSTR nam) override
 Activate a partition object. The name identifies the partition uniquely. More...
 
STATUS activate (IInterface *pPartition) override
 Activate a partition object. More...
 
STATUS get (CSTR nam, IInterface *&pPartition) const override
 Access a partition object. The name identifies the partition uniquely. More...
 
STATUS activePartition (std::string &nam, IInterface *&pPartition) const override
 Access the active partition object. More...
 
- Public Member Functions inherited from extends< BASE, Interfaces >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. More...
 
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Private Types

using CSTR = const std::string &
 
using STATUS = StatusCode
 

Private Attributes

std::string m_actorName
 Job option to set the multi-service name. More...
 
SmartIF< IPartitionControlm_actor
 reference to Partition Controller More...
 

Additional Inherited Members

- Public Types inherited from extends< BASE, Interfaces >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
- Public Types inherited from extend_interfaces< Interfaces...>
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 

Detailed Description

Author
Markus Frank
Date
2004-06-24

Definition at line 12 of file PartitionSwitchTool.cpp.

Member Typedef Documentation

using PartitionSwitchTool::CSTR = const std::string&
private

Definition at line 14 of file PartitionSwitchTool.cpp.

Definition at line 15 of file PartitionSwitchTool.cpp.

Constructor & Destructor Documentation

PartitionSwitchTool::PartitionSwitchTool ( const std::string &  typ,
const std::string &  nam,
const IInterface parent 
)
inline

Standard constructor.

Definition at line 27 of file PartitionSwitchTool.cpp.

28  : base_class( typ, nam , parent)
29  {
30  declareProperty("Actor", m_actorName = "EventDataService");
31  }
extends base_class
Typedef to this class.
Definition: extends.h:14
std::string m_actorName
Job option to set the multi-service name.
PartitionSwitchTool::~PartitionSwitchTool ( )
overridedefault

Standard destructor.

Member Function Documentation

void PartitionSwitchTool::_check ( STATUS  sc,
CSTR  msg 
) const
inline

Definition at line 61 of file PartitionSwitchTool.cpp.

61  {
62  MsgStream log(msgSvc(), name());
63  log << MSG::ERROR << msg << " Status=" << sc.getCode() << endmsg;
64  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
unsigned long getCode() const
Get the status code by value.
Definition: StatusCode.h:93
STATUS PartitionSwitchTool::activate ( CSTR  nam)
inlineoverride

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

Definition at line 88 of file PartitionSwitchTool.cpp.

88  {
89  STATUS sc = m_actor ? m_actor->activate(nam) : NO_INTERFACE;
90  CHECK(sc, "Cannot activate partition: "+nam);
91  }
#define CHECK(x, y)
SmartIF< IPartitionControl > m_actor
reference to Partition Controller
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode activate(const std::string &name)=0
Activate a partition object. The name identifies the partition uniquely.
STATUS PartitionSwitchTool::activate ( IInterface pPartition)
inlineoverride

Activate a partition object.

Definition at line 93 of file PartitionSwitchTool.cpp.

93  {
94  STATUS sc = m_actor ? m_actor->activate(pPartition) : NO_INTERFACE;
95  CHECK(sc, "Cannot activate partition by Interface.");
96  }
#define CHECK(x, y)
SmartIF< IPartitionControl > m_actor
reference to Partition Controller
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode activate(const std::string &name)=0
Activate a partition object. The name identifies the partition uniquely.
STATUS PartitionSwitchTool::activePartition ( std::string &  nam,
IInterface *&  pPartition 
) const
inlineoverride

Access the active partition object.

Definition at line 103 of file PartitionSwitchTool.cpp.

103  {
104  STATUS sc = m_actor ? m_actor->activePartition(nam, pPartition) : NO_INTERFACE;
105  CHECK(sc, "Cannot determine active partition.");
106  }
virtual StatusCode activePartition(std::string &name, IInterface *&pPartition) const =0
Access the active partition object.
#define CHECK(x, y)
SmartIF< IPartitionControl > m_actor
reference to Partition Controller
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
STATUS PartitionSwitchTool::create ( CSTR  nam,
CSTR  typ 
)
inlineoverride

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

Definition at line 68 of file PartitionSwitchTool.cpp.

68  {
69  STATUS sc = m_actor ? m_actor->create(nam,typ) : NO_INTERFACE;
70  CHECK(sc, "Cannot create partition: "+nam+" of type "+typ);
71  }
virtual StatusCode create(const std::string &name, const std::string &type)=0
Create a partition object. The name identifies the partition uniquely.
#define CHECK(x, y)
SmartIF< IPartitionControl > m_actor
reference to Partition Controller
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
STATUS PartitionSwitchTool::create ( CSTR  nam,
CSTR  typ,
IInterface *&  pPartition 
)
inlineoverride

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

Definition at line 73 of file PartitionSwitchTool.cpp.

73  {
74  STATUS sc = m_actor ? m_actor->create(nam,typ,pPartition) : NO_INTERFACE;
75  CHECK(sc, "Cannot create partition: "+nam+" of type "+typ);
76  }
virtual StatusCode create(const std::string &name, const std::string &type)=0
Create a partition object. The name identifies the partition uniquely.
#define CHECK(x, y)
SmartIF< IPartitionControl > m_actor
reference to Partition Controller
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
STATUS PartitionSwitchTool::drop ( CSTR  nam)
inlineoverride

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

Definition at line 78 of file PartitionSwitchTool.cpp.

78  {
79  STATUS sc = m_actor ? m_actor->drop(nam) : NO_INTERFACE;
80  CHECK(sc, "Cannot drop partition: "+nam);
81  }
#define CHECK(x, y)
SmartIF< IPartitionControl > m_actor
reference to Partition Controller
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode drop(const std::string &name)=0
Drop a partition object. The name identifies the partition uniquely.
STATUS PartitionSwitchTool::drop ( IInterface pPartition)
inlineoverride

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

Definition at line 83 of file PartitionSwitchTool.cpp.

83  {
84  STATUS sc = m_actor ? m_actor->drop(pPartition) : NO_INTERFACE;
85  CHECK(sc, "Cannot drop partition by Interface.");
86  }
#define CHECK(x, y)
SmartIF< IPartitionControl > m_actor
reference to Partition Controller
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode drop(const std::string &name)=0
Drop a partition object. The name identifies the partition uniquely.
STATUS PartitionSwitchTool::finalize ( )
inlineoverride

Finalize.

Definition at line 56 of file PartitionSwitchTool.cpp.

56  {
57  m_actor = nullptr;
58  return AlgTool::finalize();
59  }
StatusCode finalize() override
Definition: AlgTool.cpp:395
SmartIF< IPartitionControl > m_actor
reference to Partition Controller
STATUS PartitionSwitchTool::get ( CSTR  nam,
IInterface *&  pPartition 
) const
inlineoverride

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

Definition at line 98 of file PartitionSwitchTool.cpp.

98  {
99  STATUS sc = m_actor ? m_actor->get(nam, pPartition) : NO_INTERFACE;
100  CHECK(sc, "Cannot get partition "+nam);
101  }
#define CHECK(x, y)
SmartIF< IPartitionControl > m_actor
reference to Partition Controller
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode get(const std::string &name, IInterface *&pPartition) const =0
Access a partition object. The name identifies the partition uniquely.
STATUS PartitionSwitchTool::initialize ( )
inlineoverride

Initialize.

Access partitioned multi-service

Definition at line 36 of file PartitionSwitchTool.cpp.

36  {
39  MsgStream log(msgSvc(), name());
40  if ( !sc.isSuccess() ) {
41  log << MSG::ERROR << "Cannot initialize base class!" << endmsg;
42  return sc;
43  }
44  m_actor = nullptr;
45  IPartitionControl* tmpPtr = nullptr;
46  sc = service(m_actorName, tmpPtr);
47  m_actor = tmpPtr;
48  if ( !sc.isSuccess() ) {
49  log << MSG::ERROR << "Cannot retrieve partition controller \""
50  << m_actorName << "\"!" << endmsg;
51  return sc;
52  }
53  return sc;
54  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode initialize() override
Definition: AlgTool.cpp:325
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::string m_actorName
Job option to set the multi-service name.
SmartIF< IPartitionControl > m_actor
reference to Partition Controller
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Create / access partitions.

Member Data Documentation

SmartIF<IPartitionControl> PartitionSwitchTool::m_actor
private

reference to Partition Controller

Definition at line 22 of file PartitionSwitchTool.cpp.

std::string PartitionSwitchTool::m_actorName
private

Job option to set the multi-service name.

Definition at line 20 of file PartitionSwitchTool.cpp.


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