The Gaudi Framework  v30r3 (a5ef0a68)
GaudiPython Namespace Reference

GaudiPython.h GaudiPython/GaudiPython.h. More...

Namespaces

 Bindings
 
 GaudiAlgs
 
 GaudiHandles
 
 GaudiPythonConf
 
 HistoUtils
 
 Persistency
 
 Pythonizations
 
 TupleUtils
 

Classes

struct  _identity
 It is here due to 'missing'(?) std::identity. More...
 
class  AlgDecorator
 
class  CallbackStreamBuf
 
struct  Helper
 
class  HistoDecorator
 Simple decorator class to allow to reuse the functionality of GaudiHistos<TYPE> class in pythin. More...
 
struct  Interface
 Minor mofidication of original Pere's structure GaudiPython::Interface This helper class is nesessary to perform C++ castings from python. More...
 
struct  Interface< IInterface >
 
struct  Printer
 
struct  Printer< ContainedObject >
 
struct  Printer< DataObject >
 
class  PyAlg
 general class to embed the existing algorithm/base class into the python More...
 
class  PyAlgorithm
 Python Algorithm base class. More...
 
class  TupleAlgDecorator
 Simple class to perform the "decoration" of Tuples in Python/ROOT. More...
 
class  TupleDecorator
 Simple class which performs the decoration of the standard N-Tuple. More...
 
class  TupleToolDecorator
 Simple class to perform the "decoration" of Tuples in Python/ROOT. More...
 

Typedefs

typedef std::vector< double > Vector
 useful type definition for implicit loos More...
 
typedef Vector Row
 
typedef std::vector< RowMatrix
 

Functions

GAUDI_API StatusCode call_python_method (PyObject *self, const char *method)
 call the python method More...
 
int GAUDI_API call_python_method (PyObject *self, const char *method, char *buf)
 call a python method with a string as an argument More...
 

Variables

list __path__
 

Detailed Description

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

Typedef Documentation

Definition at line 21 of file Vector.h.

Definition at line 20 of file Vector.h.

useful type definition for implicit loos

Definition at line 19 of file Vector.h.

Function Documentation

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 12 of file CallbackStreamBuf.cpp.

13 {
14  if ( !self || !method ) {
15  return 1;
16  }
17  PyObject* r = PyObject_CallMethod( self, const_cast<char*>( method ), const_cast<char*>( "s" ), buf );
18  if ( !r ) {
19  std::string err( "Unsuccessful call to bound Python method" );
20  err += method;
21  PyErr_SetString( PyExc_TypeError, err.c_str() );
22  PyErr_Print();
23  return 1;
24  }
25  Py_DECREF( r );
26  return 0;
27 }
STL class.
StatusCode GaudiPython::call_python_method ( PyObject *  self,
const char *  method 
)

call the python method

Definition at line 29 of file Algorithm.cpp.

30 {
32  // check arguments
33  if ( !self || !method ) {
34  return StatusCode::FAILURE;
35  }
36 
37  // call Python
38  PyObject* r = PyObject_CallMethod( self, chr( method ), nullptr );
39 
40  if ( !r ) {
41  PyErr_Print();
42  return sc;
43  } // RETURN
44 
45  if ( PyInt_Check( r ) ) {
46  sc = StatusCode( PyInt_AS_LONG( r ) );
47  Py_DECREF( r );
48  return sc;
49  } // RETURN
50 
51  // look for the method getCode with the signature:
52  // ' int getCode() '
53  PyObject* c = PyObject_CallMethod( r, chr( "getCode" ), nullptr );
54 
55  if ( !c ) {
56  PyErr_Print();
57  } else if ( PyLong_Check( c ) ) {
58  sc = StatusCode( PyLong_AsLong( c ) );
59  } else {
60  std::string msg( " call_python_method unexpected type from '" );
61  msg += method;
62  msg += "().getCode()' ";
63  PyErr_SetString( PyExc_TypeError, msg.c_str() );
64  PyErr_Print();
65  }
66  // release used objects
67  Py_XDECREF( c );
68  Py_XDECREF( r );
69  //
70  return sc;
71 }
constexpr static const auto FAILURE
Definition: StatusCode.h:88
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51

Variable Documentation

list GaudiPython.__path__
private
Initial value:
1 = [d for d in [os.path.join(d, 'GaudiPython') for d in sys.path if d]
2  if (d.startswith('/builds/gaudi/Gaudi/build-gcc62') or
3  d.startswith('/builds/gaudi/Gaudi')) and
4  (os.path.exists(d) or 'python.zip' in d)]

Definition at line 3 of file __init__.py.