Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Protected Member Functions | Protected Attributes
CPyOutbuf Class Reference

List of all members.

Public Member Functions

 CPyOutbuf (PyObject *obj)
 ~CPyOutbuf ()

Protected Member Functions

int_type overflow (int_type c)
std::streamsize xsputn (const char *s, std::streamsize count)

Protected Attributes

PyObject * m_PyObj

Detailed Description

Definition at line 5151 of file arc_wrap.cpp.


Constructor & Destructor Documentation

CPyOutbuf::CPyOutbuf ( PyObject *  obj) [inline]

Definition at line 5154 of file arc_wrap.cpp.

                              {
         m_PyObj = obj;
         Py_INCREF(m_PyObj);
     }
CPyOutbuf::~CPyOutbuf ( ) [inline]

Definition at line 5158 of file arc_wrap.cpp.

                  {
         Py_DECREF(m_PyObj);
     }

Member Function Documentation

int_type CPyOutbuf::overflow ( int_type  c) [inline, protected]

Definition at line 5162 of file arc_wrap.cpp.

                                   {
         // Call to PyGILState_Ensure ensures there is Python
         // thread state created/assigned.
         PyGILState_STATE gstate = PyGILState_Ensure();
         PyObject_CallMethod(m_PyObj, (char*) "write", (char*) "c", c);
         PyGILState_Release(gstate);
         return c;
     }
std::streamsize CPyOutbuf::xsputn ( const char *  s,
std::streamsize  count 
) [inline, protected]

Definition at line 5170 of file arc_wrap.cpp.

                                                              {
         // Call to PyGILState_Ensure ensures there is Python
         // thread state created/assigned.
         PyGILState_STATE gstate = PyGILState_Ensure();
         PyObject_CallMethod(m_PyObj, (char*) "write", (char*) "s#", s, int(count));
         PyGILState_Release(gstate);
         return count;
     }

Member Data Documentation

PyObject* CPyOutbuf::m_PyObj [protected]

Definition at line 5178 of file arc_wrap.cpp.


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