Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
CallbackStreamBuf.h
Go to the documentation of this file.
1 #ifndef GAUDIPYTHON_CALLBACKSTREAMBUF_H
2 #define GAUDIPYTHON_CALLBACKSTREAMBUF_H
3 // ============================================================================
4 #include "Python.h" //included for the python API
5 // ============================================================================
6 #include <array>
7 #include <sstream> //included for stringbuf
8 // ============================================================================
9 #include "GaudiKernel/Kernel.h"
11 // ============================================================================
12 
13 namespace GaudiPython {
14  int GAUDI_API call_python_method( PyObject* self, const char* method, char* buf );
15 
17  private:
18  class PyObject_t {
19  PyObject* m_obj;
20 
21  public:
22  PyObject_t( PyObject* obj = nullptr ) : m_obj( obj ) {
23  if ( m_obj ) Py_INCREF( m_obj );
24  }
26  if ( m_obj ) Py_DECREF( m_obj );
27  }
28  PyObject* get() { return m_obj; }
29  };
31  std::array<char, 512> m_callbackBuff; // used for passing the flushed chars in the python callback
32 
33  public:
34  CallbackStreamBuf( PyObject* self );
35  int sync() override;
36  };
37 } // namespace GaudiPython
38 
39 #endif
std::array< char, 512 > m_callbackBuff
GaudiPython.h GaudiPython/GaudiPython.h.
Definition: AlgDecorators.h:37
#define GAUDI_API
Definition: Kernel.h:71
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
Definition: Algorithm.cpp:28