2 #include "GaudiPython/CallbackStreamBuf.h"
4 #include "GaudiKernel/Bootstrap.h"
14 ( PyObject*
self,
const char* method,
char* buf )
16 if ( !
self || !method ) {
return 1 ; }
17 PyObject* r = PyObject_CallMethod(
self, const_cast<char*>(method),
18 const_cast<char*>(
"s"), buf);
20 std::string err(
"Unsuccessful call to bound Python method");
22 PyErr_SetString( PyExc_TypeError , err.c_str() ) ;
44 for ( length = 0, x = pbase(); x < epptr(); ++x , ++length ) ;
46 memcpy( m_callbackBuff.data(), pbase(), std::min(length, m_callbackBuff.size()) );
47 m_callbackBuff[ std::min(length, m_callbackBuff.size()) ] =
'\0';
51 setp( pbase() , pbase() );
52 setg( eback(), eback(), eback() );
int sync() override
reimplementation of stringbuf::sync()
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
CallbackStreamBuf(PyObject *self)
CallbackStreamBuf constructor.