|
ATLAS Offline Software
|
Go to the documentation of this file.
27 #include "GaudiKernel/System.h"
28 #include "GaudiKernel/MsgStream.h"
29 #include "GaudiKernel/ServiceHandle.h"
63 return PyAthena::callPyMethod(
m_self,
"sysInitialize" );
70 return PyAthena::callPyMethod(
m_self,
"sysReinitialize" );
76 return PyAthena::callPyMethod(
m_self,
"sysStart" );
82 return PyAthena::callPyMethod(
m_self,
"sysStop" );
89 return PyAthena::callPyMethod(
m_self,
"sysFinalize" );
97 PyObject* pycontext = PyCapsule_New (
const_cast<EventContext*
>(&getContext()),
nullptr,
nullptr);
100 Py_DECREF (pycontext);
108 (
"PyAthena::PyComponentMgr/PyComponentMgr",
name() );
109 if ( !pyMgr.retrieve().isSuccess() ) {
110 ATH_MSG_ERROR(
"Could not retrieve service [" << pyMgr.typeAndName()
112 return StatusCode::FAILURE;
116 m_self = pyMgr->pyObject(
this );
118 if (
m_self == Py_None ) {
120 return StatusCode::FAILURE;
135 return tname.c_str();
147 PyObject* pyobj = TPython::CPPInstance_FromVoidPtr
152 pyobj = TPython::CPPInstance_FromVoidPtr ((
void*)
this,
"PyAthena::Alg");
154 (
"could not dyncast component [" <<
name() <<
"] to a python "
155 <<
"object of type [" << this->
typeName() <<
"] (probably a missing "
156 <<
"dictionary)" <<
endmsg
157 <<
"fallback to [PyAthena::Alg]...");
162 <<
name() <<
"] to a pyobject of type ["
165 if ( -1 == PyObject_SetAttrString(o,
"_cppHandle", pyobj) ) {
168 (
"Could not attach C++ handle [" <<
name() <<
"] to its python "
170 if ( -1 == PyObject_SetAttrString(o,
"_cppHandle", Py_None) ) {
173 (
"could not attach a dummy C++ handle [" <<
name() <<
"] to its "
PyObject * m_self
Pointer to self (from the python world)
virtual const char * typeName() const override
return the std::type_info name of the underlying py-component This is used by concrete implementation...
virtual ~Alg()
Destructor:
virtual bool setPyAttr(PyObject *pyobj) override
attach the C++ component to its python cousin
virtual StatusCode start() override
virtual StatusCode reinitialize() override
virtual StatusCode initialize() override
virtual StatusCode execute() override
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual StatusCode stop() override
virtual StatusCode finalize() override
virtual StatusCode sysInitialize() override
Override sysInitialize.
std::string typeinfoName(const std::type_info &ti)
Convert a type_info to a demangled string.
::StatusCode StatusCode
StatusCode definition for legacy code.
Alg()
Default constructor:
#define ATH_MSG_WARNING(x)