9 #include "GaudiKernel/Bootstrap.h"
13 #include "GaudiPython/Algorithm.h"
23 inline char *chr(
const char*
c){
return const_cast<char*
>(
c); }
30 ( PyObject*
self,
const char* method )
37 PyObject* r = PyObject_CallMethod(
self, chr(method), chr(
""));
39 if ( 0 == r ) { PyErr_Print() ;
return sc ; }
41 if ( PyInt_Check ( r ) )
42 { sc = PyInt_AS_LONG( r ) ; Py_DECREF( r ) ;
return sc ; }
46 PyObject*
c = PyObject_CallMethod(r, chr(
"getCode"), chr(
""));
48 if ( 0 == c ) { PyErr_Print() ; }
49 else if ( PyLong_Check( c )) { sc = PyLong_AsLong( c ); }
52 std::string
msg(
" call_python_method unexpected type from '" );
54 msg +=
"().getCode()' " ;
55 PyErr_SetString( PyExc_TypeError , msg.c_str() ) ;
74 const std::string& name )
StatusCode beginRun()
Algorithm begin run.
PyAlgorithm(PyObject *self, const std::string &name)
constructor
GAUDI_API ISvcLocator * svcLocator()
StatusCode initialize()
the default (empty) implementation of IStateful::initialize() method
This class is used for returning status codes from appropriate routines.
StatusCode execute()
The action to be performed by the algorithm on an event.
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
Base class from which all concrete algorithm classes should be derived.
StatusCode start()
the default (empty) implementation of IStateful::start() method
StatusCode stop()
the default (empty) implementation of IStateful::stop() method
StatusCode finalize()
the default (empty) implementation of IStateful::finalize() method
StatusCode endRun()
Algorithm end run. This method is called at the end of the event loop.