13 if ( !
self || !method ) {
return 1; }
14 PyObject* r = PyObject_CallMethod(
self, const_cast<char*>( method ), const_cast<char*>(
"s" ), buf );
16 std::string err(
"Unsuccessful call to bound Python method" );
18 PyErr_SetString( PyExc_TypeError, err.
c_str() );
37 for ( length = 0, x = pbase(); x < epptr(); ++x, ++length )
40 memcpy( m_callbackBuff.data(), pbase(),
std::min( length, m_callbackBuff.size() ) );
41 m_callbackBuff[
std::min( length, m_callbackBuff.size() )] =
'\0';
45 setp( pbase(), pbase() );
46 setg( eback(), eback(), eback() );
int sync() override
reimplementation of stringbuf::sync()
CallbackStreamBuf(PyObject *self)
CallbackStreamBuf constructor.
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method