GaudiPython::CallbackStreamBuf Class Reference

#include </tmp/marcocle/lhcb-release/1122/GAUDI/GAUDI_v27r0/InstallArea/x86_64-slc6-gcc49-opt/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...
 
 CallbackStreamBuf (PyObject *self)
 
int sync () override
 

Private Attributes

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

Detailed Description

Definition at line 17 of file CallbackStreamBuf.h.

Constructor & Destructor Documentation

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

CallbackStreamBuf constructor.

Definition at line 33 of file CallbackStreamBuf.cpp.

33  :
34  m_self(self)
35 { }
GaudiPython::CallbackStreamBuf::CallbackStreamBuf ( PyObject *  self)

Member Function Documentation

int GaudiPython::CallbackStreamBuf::sync ( )
override

reimplementation of stringbuf::sync()

Definition at line 40 of file CallbackStreamBuf.cpp.

41 {
42  size_t length;
43  char *x;
44  for ( length = 0, x = pbase(); x < epptr(); ++x , ++length ) ;
45  //getting in a null terminated buffer the characters
46  memcpy( m_callbackBuff.data(), pbase(), std::min(length, m_callbackBuff.size()) );
47  m_callbackBuff[ std::min(length, m_callbackBuff.size()) ] = '\0';
48  //calling the python method
50  //reseting in/out buffer pointers
51  setp( pbase() , pbase() );
52  setg( eback(), eback(), eback() );
53  return 0;
54 }
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
Definition: Algorithm.cpp:29
std::array< char, 512 > m_callbackBuff
int GaudiPython::CallbackStreamBuf::sync ( )
override

Member Data Documentation

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

Definition at line 28 of file CallbackStreamBuf.h.

PyObject_t GaudiPython::CallbackStreamBuf::m_self
private

Definition at line 27 of file CallbackStreamBuf.h.


The documentation for this class was generated from the following files: