Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 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:
Inheritance graph
[legend]
Collaboration diagram for GaudiPython::CallbackStreamBuf:
Collaboration graph
[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_typepubsetbuf (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_typepubsetbuf (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_typesetbuf (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_typeeback () const
 
char_typeegptr () const
 
char_typegptr () const
 
char_typeepptr () const
 
char_typepbase () const
 
char_typepptr () 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
//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:

Generated at Wed Dec 4 2013 14:33:22 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004