| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
GaudiPython::CallbackStreamBuf Class Reference

`#include <CallbackStreamBuf.h>`

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

## Public Member Functions
| CallbackStreamBuf (PyObject *self)
| CallbackStreamBuf constructor.
| ~CallbackStreamBuf ()
| CallbackStreamBuf destructor.
virtual int | sync ()
| reimplementation of stringbuf::sync()
Public Member Functions inherited from std::basic_stringbuf< _CharT, _Traits, _Alloc >
locale | getloc () const
locale | pubimbue (const locale &__loc)
pos_type | pubseekoff (off_type __off, ios_base::seekdir __way, ios_base::openmode __mode=ios_base::in|ios_base::out)
pos_type | pubseekpos (pos_type __sp, ios_base::openmode __mode=ios_base::in|ios_base::out)
__streambuf_type * | pubsetbuf (char_type *__s, streamsize __n)
int | pubsync ()
| basic_stringbuf (const __string_type &__str, ios_base::openmode __mode=ios_base::in|ios_base::out)
| basic_stringbuf (ios_base::openmode __mode=ios_base::in|ios_base::out)
streamsize | in_avail ()
int_type | sbumpc ()
int_type | sgetc ()
streamsize | sgetn (char_type *__s, streamsize __n)
int_type | snextc ()
int_type | sputbackc (char_type __c)
int_type | sputc (char_type __c)
streamsize | sputn (const char_type *__s, streamsize __n)
void | stossc ()
void | str (const __string_type &__s)
__string_type | str () const
int_type | sungetc ()
Public Member Functions inherited from std::basic_streambuf< _CharT, _Traits >
locale | getloc () const
locale | pubimbue (const locale &__loc)
pos_type | pubseekoff (off_type __off, ios_base::seekdir __way, ios_base::openmode __mode=ios_base::in|ios_base::out)
pos_type | pubseekpos (pos_type __sp, ios_base::openmode __mode=ios_base::in|ios_base::out)
__streambuf_type * | pubsetbuf (char_type *__s, streamsize __n)
int | pubsync ()
virtual | ~basic_streambuf ()
streamsize | in_avail ()
int_type | sbumpc ()
int_type | sgetc ()
streamsize | sgetn (char_type *__s, streamsize __n)
int_type | snextc ()
int_type | sputbackc (char_type __c)
int_type | sputc (char_type __c)
streamsize | sputn (const char_type *__s, streamsize __n)
void | stossc ()
int_type | sungetc ()

## Private Attributes
PyObject * | m_self
char * | m_callbackBuff

## Additional Inherited Members
Public Types inherited from std::basic_stringbuf< _CharT, _Traits, _Alloc >
typedef __string_type::size_type | __size_type
typedef basic_streambuf < char_type, traits_type > | __streambuf_type
typedef basic_string < char_type, _Traits, _Alloc > | __string_type
typedef _Alloc | allocator_type
typedef _CharT | char_type
typedef traits_type::int_type | int_type
typedef traits_type::off_type | off_type
typedef traits_type::pos_type | pos_type
typedef _Traits | traits_type
Protected Member Functions inherited from std::basic_stringbuf< _CharT, _Traits, _Alloc >
void | _M_stringbuf_init (ios_base::openmode __mode)
void | _M_sync (char_type *__base, __size_type __i, __size_type __o)
void | _M_update_egptr ()
void | gbump (int __n)
virtual void | imbue (const locale &)
virtual int_type | overflow (int_type __c=traits_type::eof())
virtual int_type | pbackfail (int_type __c=traits_type::eof())
void | pbump (int __n)
virtual pos_type | seekoff (off_type __off, ios_base::seekdir __way, ios_base::openmode __mode=ios_base::in|ios_base::out)
virtual pos_type | seekpos (pos_type __sp, ios_base::openmode __mode=ios_base::in|ios_base::out)
virtual __streambuf_type * | setbuf (char_type *__s, streamsize __n)
void | setg (char_type *__gbeg, char_type *__gnext, char_type *__gend)
void | setp (char_type *__pbeg, char_type *__pend)
virtual streamsize | showmanyc ()
virtual int_type | uflow ()
virtual int_type | underflow ()
virtual streamsize | xsgetn (char_type *__s, streamsize __n)
virtual streamsize | xsputn (const char_type *__s, streamsize __n)
char_type * | eback () const
char_type * | egptr () const
char_type * | gptr () const
char_type * | epptr () const
char_type * | pbase () const
char_type * | pptr () const
Protected Attributes inherited from std::basic_stringbuf< _CharT, _Traits, _Alloc >
locale | _M_buf_locale
char_type * | _M_in_beg
char_type * | _M_in_cur
char_type * | _M_in_end
char_type * | _M_out_beg
char_type * | _M_out_cur
char_type * | _M_out_end
ios_base::openmode | _M_mode
__string_type | _M_string

## Detailed Description

Definition at line 15 of file CallbackStreamBuf.h.

## Constructor & Destructor Documentation

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

CallbackStreamBuf constructor.

Definition at line 40 of file CallbackStreamBuf.cpp.

: stringbuf(), m_self(self)
{
Py_INCREF(this->m_self);
this->m_callbackBuff = new char[512]; //used for passing the flushed chars in the python callback
}

GaudiPython::CallbackStreamBuf::~CallbackStreamBuf | ( |  | ) |

CallbackStreamBuf destructor.

Definition at line 49 of file CallbackStreamBuf.cpp.

{
Py_DECREF( this->m_self );
delete this->m_callbackBuff;
}

## Member Function Documentation

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

reimplementation of stringbuf::sync()

Reimplemented from std::basic_stringbuf< _CharT, _Traits, _Alloc >.

Definition at line 58 of file CallbackStreamBuf.cpp.

{
int length;
char *x;
for ( length = 0, x = this->pbase(); x < this->epptr(); x++ , length++ ) ;
//getting in a null terminated buffer the characters
memcpy( this->m_callbackBuff, this->pbase(), min(length, 512) );
this->m_callbackBuff[ min(length, 512) ] = '\0';
//calling the python method
GaudiPython::call_python_method(this->m_self, "_sync", this->m_callbackBuff);
//reseting in/out buffer pointers
setp( this->pbase() , this->pbase() );
setg( this->eback(), this->eback(), this->eback() );
return 0;
}

## Member Data Documentation

char* GaudiPython::CallbackStreamBuf::m_callbackBuff
| private

Definition at line 19 of file CallbackStreamBuf.h.

PyObject* GaudiPython::CallbackStreamBuf::m_self
| private

Definition at line 18 of file CallbackStreamBuf.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiPython/GaudiPython/CallbackStreamBuf.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiPython/src/Lib/CallbackStreamBuf.cpp