The Gaudi Framework  master (594c33fa)
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...
 
- Public Member Functions inherited from std::stringbuf
pptr (T... args)
 
epptr (T... args)
 
eback (T... args)
 
setp (T... args)
 
sputbackc (T... args)
 
sgetc (T... args)
 
stringbuf (T... args)
 
sungetc (T... args)
 
pubseekoff (T... args)
 
seekoff (T... args)
 
str (T... args)
 
sync (T... args)
 
xsputn (T... args)
 
pbase (T... args)
 
pubimbue (T... args)
 
showmanyc (T... args)
 
egptr (T... args)
 
seekpos (T... args)
 
underflow (T... args)
 
setbuf (T... args)
 
gbump (T... args)
 
in_avail (T... args)
 
swap (T... args)
 
pbackfail (T... args)
 
sputc (T... args)
 
xsgetn (T... args)
 
uflow (T... args)
 
gptr (T... args)
 
sputn (T... args)
 
sgetn (T... args)
 
sbumpc (T... args)
 
overflow (T... args)
 
operator= (T... args)
 
pbump (T... args)
 
pubsetbuf (T... args)
 
pubsync (T... args)
 
imbue (T... args)
 
setg (T... args)
 
snextc (T... args)
 
getloc (T... args)
 
pubseekpos (T... args)
 

Private Attributes

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

Detailed Description

Definition at line 26 of file CallbackStreamBuf.h.

Constructor & Destructor Documentation

◆ CallbackStreamBuf()

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

CallbackStreamBuf constructor.

Definition at line 39 of file CallbackStreamBuf.cpp.

39 : m_self( self ) {}

Member Function Documentation

◆ sync()

int GaudiPython::CallbackStreamBuf::sync ( )
override

reimplementation of stringbuf::sync()

Definition at line 44 of file CallbackStreamBuf.cpp.

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

Member Data Documentation

◆ m_callbackBuff

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

Definition at line 41 of file CallbackStreamBuf.h.

◆ m_self

PyObject_t GaudiPython::CallbackStreamBuf::m_self
private

Definition at line 40 of file CallbackStreamBuf.h.


The documentation for this class was generated from the following files:
std::array::size
T size(T... args)
std::stringbuf::pbase
T pbase(T... args)
GaudiPython::CallbackStreamBuf::m_self
PyObject_t m_self
Definition: CallbackStreamBuf.h:40
std::stringbuf::setg
T setg(T... args)
std::stringbuf::eback
T eback(T... args)
std::stringbuf::setp
T setp(T... args)
std::min
T min(T... args)
GaudiPython::CallbackStreamBuf::m_callbackBuff
std::array< char, 512 > m_callbackBuff
Definition: CallbackStreamBuf.h:41
GaudiPython::CallbackStreamBuf::PyObject_t::get
PyObject * get()
Definition: CallbackStreamBuf.h:38
std::memcpy
T memcpy(T... args)
std::array::data
T data(T... args)
GaudiPython::call_python_method
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
Definition: Algorithm.cpp:48