28#include "GaudiKernel/MsgStream.h"
29#include "GaudiKernel/Bootstrap.h"
30#include "GaudiKernel/IConversionSvc.h"
31#include "GaudiKernel/ISvcLocator.h"
32#include "GaudiKernel/IAlgorithm.h"
33#include "GaudiKernel/DataSvc.h"
44 char* execalgs =
const_cast< char*
>(
"executeAlgorithms" );
54 SmartIF<IEventProcessor> ep{Gaudi::svcLocator()->service(
"PyAthenaEventLoopMgr",
false )};
85 if ( ! PyObject_HasAttrString( mgr, execalgs ) )
87 PyErr_SetString( PyExc_TypeError,
"given object is not a manager" );
98 PyObject* pyelm = PyImport_AddModule(
const_cast< char*
>(
"AthenaServices.PyAthenaEventLoopMgr" ) );
101 if (PyModule_AddObject( pyelm,
const_cast< char*
>(
"EventLoopMgr" ), mgr ) < 0) {
107 PyObject* pyself = PyCapsule_New( (
void*)
static_cast< IEventSeek*
>(
this ),
nullptr,
nullptr );
108 PyObject* method = PyUnicode_FromString(
"_installServices" );
109 PyObject*
result = PyObject_CallMethodObjArgs( mgr, method, pyself, 0 );
117 if ( old !=
nullptr )
120 Py_INCREF( Py_None );
129 Py_INCREF( Py_None );
145 PyObject* modpyelm = PyImport_ImportModule(
const_cast< char*
>(
"AthenaServices.PyAthenaEventLoopMgr" ) );
148 PyObject* pyelm = PyObject_GetAttrString( modpyelm,
const_cast< char*
>(
"PyAthenaEventLoopMgr" ) );
149 Py_DECREF( modpyelm );
153 PyObject* self = PyObject_Call( pyelm, args,
nullptr );
168 return StatusCode::FAILURE;
179 return StatusCode::FAILURE;
193 PyObject* pycontext = PyCapsule_New (
const_cast<EventContext*
>(&ctx),
nullptr,
nullptr);
195 (
char*)
"O", pycontext);
196 Py_DECREF (pycontext);
201 return StatusCode::FAILURE;
204 if ( PyLong_Check(
result ) )
206 StatusCode
sc = StatusCode( (
int) PyLong_AS_LONG(
result ) );
212 MsgStream log( msgSvc(),
name() );
214 <<
"result from python event loop manager has unexpected type."
217 return StatusCode::FAILURE;
Implementation of the AthenaEventLoopMgr that allows selective and specific overrides in python.
virtual StatusCode initialize() override
implementation of IAppMgrUI::initalize
virtual StatusCode finalize() override
implementation of IAppMgrUI::finalize
StringProperty m_clearStorePolicy
virtual const std::string & name() const override
AthenaEventLoopMgr(const std::string &nam, ISvcLocator *svcLoc)
Standard Constructor.
virtual StatusCode executeAlgorithms(const EventContext &)
Run the algorithms for the current event.
Abstract interface for seeking within an event stream.
virtual StatusCode initialize()
implementation of IAppMgrUI::initalize
PyObject * setManager(PyObject *)
actual manager object
static PyAthenaEventLoopMgr * pointer()
outside access
PyAthenaEventLoopMgr(const std::string &name, ISvcLocator *svcLoc)
Standard Constructor.
virtual StatusCode executeAlgorithms(const EventContext &)
Run the algorithms for the current event.
virtual StatusCode finalize()
implementation of IAppMgrUI::finalize
PyAthenaEventLoopMgr()
Unimplemented features to keep Reflex happy.