GaudiPython.h GaudiPython/GaudiPython.h.
More...
GaudiPython.h GaudiPython/GaudiPython.h.
Namespace for all classes interfacing Gaudi to Python.
The general namespace to hide all Gaudi-python related classes
- Author
- Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
- Date
- 2005-08-04
useful type definition for implicit loos
Definition at line 19 of file Vector.h.
int GaudiPython::call_python_method |
( |
PyObject * |
self, |
|
|
const char * |
method, |
|
|
char * |
buf |
|
) |
| |
call a python method with a string as an argument
Definition at line 14 of file CallbackStreamBuf.cpp.
16 if ( !
self || !method ) {
return 1 ; }
17 PyObject* r = PyObject_CallMethod(
self, const_cast<char*>(method),
18 const_cast<char*>(
"s"), buf);
20 std::string err(
"Unsuccessful call to bound Python method");
22 PyErr_SetString( PyExc_TypeError , err.c_str() ) ;
StatusCode GaudiPython::call_python_method |
( |
PyObject * |
self, |
|
|
const char * |
method |
|
) |
| |
call the python method
Definition at line 29 of file Algorithm.cpp.
36 PyObject* r = PyObject_CallMethod(
self, chr(method),
nullptr );
38 if ( !r ) { PyErr_Print() ;
return sc ; }
40 if ( PyInt_Check ( r ) )
41 { sc = PyInt_AS_LONG( r ) ; Py_DECREF( r ) ;
return sc ; }
45 PyObject*
c = PyObject_CallMethod(r, chr(
"getCode"),
nullptr);
47 if ( !c ) { PyErr_Print() ; }
48 else if ( PyLong_Check( c )) { sc = PyLong_AsLong( c ); }
53 msg +=
"().getCode()' " ;
54 PyErr_SetString( PyExc_TypeError ,
msg.c_str() ) ;
This class is used for returning status codes from appropriate routines.