Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (d98a2936)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GaudiPython::CallbackStreamBuf Class Reference

#include </builds/gaudi/Gaudi/GaudiPython/include/GaudiPython/CallbackStreamBuf.h>

Inheritance diagram for GaudiPython::CallbackStreamBuf:
Collaboration diagram for GaudiPython::CallbackStreamBuf:

Classes

class  PyObject_t
 

Public Member Functions

 CallbackStreamBuf (PyObject *self)
 CallbackStreamBuf constructor. More...
 
int sync () override
 reimplementation of stringbuf::sync() More...
 

Private Attributes

PyObject_t m_self
 
std::array< char, 512 > m_callbackBuff
 

Detailed Description

Definition at line 25 of file CallbackStreamBuf.h.

Constructor & Destructor Documentation

◆ CallbackStreamBuf()

GaudiPython::CallbackStreamBuf::CallbackStreamBuf ( PyObject *  self)

CallbackStreamBuf constructor.

Definition at line 40 of file CallbackStreamBuf.cpp.

40 : m_self( self ) {}

Member Function Documentation

◆ sync()

int GaudiPython::CallbackStreamBuf::sync ( )
override

reimplementation of stringbuf::sync()

Definition at line 45 of file CallbackStreamBuf.cpp.

45  {
46  size_t length;
47  char* x;
48  for ( length = 0, x = pbase(); x < epptr(); ++x, ++length )
49  ;
50  // getting in a null terminated buffer the characters
51  memcpy( m_callbackBuff.data(), pbase(), std::min( length, m_callbackBuff.size() ) );
52  m_callbackBuff[std::min( length, m_callbackBuff.size() )] = '\0';
53  // calling the python method
55  // reseting in/out buffer pointers
56  setp( pbase(), pbase() );
57  setg( eback(), eback(), eback() );
58  return 0;
59 }

Member Data Documentation

◆ m_callbackBuff

std::array<char, 512> GaudiPython::CallbackStreamBuf::m_callbackBuff
private

Definition at line 40 of file CallbackStreamBuf.h.

◆ m_self

PyObject_t GaudiPython::CallbackStreamBuf::m_self
private

Definition at line 39 of file CallbackStreamBuf.h.


The documentation for this class was generated from the following files:
GaudiPython::CallbackStreamBuf::m_self
PyObject_t m_self
Definition: CallbackStreamBuf.h:39
GaudiPython::CallbackStreamBuf::m_callbackBuff
std::array< char, 512 > m_callbackBuff
Definition: CallbackStreamBuf.h:40
GaudiPython::CallbackStreamBuf::PyObject_t::get
PyObject * get()
Definition: CallbackStreamBuf.h:37
GaudiPython::call_python_method
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
Definition: Algorithm.cpp:48