| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Member Functions | Private Attributes | List of all members
GaudiPython::CallbackStreamBuf Class Reference

`#include <GaudiPython/CallbackStreamBuf.h>`

Inheritance diagram for GaudiPython::CallbackStreamBuf:
[legend]
Collaboration diagram for GaudiPython::CallbackStreamBuf:
[legend]

## 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
T | pptr (T...args)
T | epptr (T...args)
T | eback (T...args)
T | setp (T...args)
T | sputbackc (T...args)
T | sgetc (T...args)
T | stringbuf (T...args)
T | sungetc (T...args)
T | pubseekoff (T...args)
T | seekoff (T...args)
T | str (T...args)
T | sync (T...args)
T | xsputn (T...args)
T | pbase (T...args)
T | pubimbue (T...args)
T | showmanyc (T...args)
T | egptr (T...args)
T | seekpos (T...args)
T | underflow (T...args)
T | setbuf (T...args)
T | gbump (T...args)
T | in_avail (T...args)
T | swap (T...args)
T | pbackfail (T...args)
T | sputc (T...args)
T | xsgetn (T...args)
T | uflow (T...args)
T | gptr (T...args)
T | sputn (T...args)
T | sgetn (T...args)
T | sbumpc (T...args)
T | overflow (T...args)
T | operator= (T...args)
T | pbump (T...args)
T | pubsetbuf (T...args)
T | pubsync (T...args)
T | imbue (T...args)
T | setg (T...args)
T | snextc (T...args)
T | getloc (T...args)
T | pubseekpos (T...args)

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

32 : m_self( self ) {}
GaudiPython::CallbackStreamBuf::m_self
PyObject_t m_self
Definition: CallbackStreamBuf.h:35

## Member Function Documentation

int GaudiPython::CallbackStreamBuf::sync | ( |  | ) |
| override

reimplementation of stringbuf::sync()

Definition at line 37 of file CallbackStreamBuf.cpp.

38 {
39 size_t length;
40 char* x;
41 for ( length = 0, x = pbase(); x < epptr(); ++x, ++length )
42 ;
43 // getting in a null terminated buffer the characters
44 memcpy( m_callbackBuff.data(), pbase(), std::min( length, m_callbackBuff.size() ) );
45 m_callbackBuff[std::min( length, m_callbackBuff.size() )] = '\0';
46 // calling the python method
47 GaudiPython::call_python_method( m_self.get(), "_sync", m_callbackBuff.data() );
48 // reseting in/out buffer pointers
49 setp( pbase(), pbase() );
50 setg( eback(), eback(), eback() );
51 return 0;
52 }
GaudiPython::CallbackStreamBuf::m_self
PyObject_t m_self
Definition: CallbackStreamBuf.h:35
GaudiPython::CallbackStreamBuf::PyObject_t::get
PyObject * get()
Definition: CallbackStreamBuf.h:33
GaudiPython::CallbackStreamBuf::m_callbackBuff
std::array< char, 512 > m_callbackBuff
Definition: CallbackStreamBuf.h:36
std::min
T min(T...args)
std::array::data
T data(T...args)
std::memcpy
T memcpy(T...args)
std::array::size
T size(T...args)
std::stringbuf::pbase
T pbase(T...args)
std::stringbuf::setg
T setg(T...args)
std::stringbuf::eback
T eback(T...args)
std::stringbuf::setp
T setp(T...args)
GaudiPython::call_python_method
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
Definition: Algorithm.cpp:29

## Member Data Documentation

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

Definition at line 36 of file CallbackStreamBuf.h.

PyObject_t GaudiPython::CallbackStreamBuf::m_self
| private

Definition at line 35 of file CallbackStreamBuf.h.

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

- GaudiPython/GaudiPython/CallbackStreamBuf.h
- GaudiPython/src/Lib/CallbackStreamBuf.cpp