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;
134 static const std::string tname = System::typeinfoName(
typeid(*
this));
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 "