itom 2.2.0
|
static class which implements a new python type. The members cout and cerr of the python system are set to variables of this type PyStream in order to observe the python's cout and cerr stream and to transmit the stream's content to the main application. More...
Classes | |
struct | PythonStream |
* this struct builds the basic structure of the new python type. More... | |
Static Public Member Functions | |
static void | PythonStream_dealloc (PythonStream *self) |
static method which is called if variable of type PyStream in python workspace has been deleted in order to free allocated memory. | |
static int | PythonStream_init (PythonStream *self, PyObject *args, PyObject *kwds) |
static init method, which is called if any variable of type PyStream is initialized. This method extracts type value from args. | |
static PyObject * | PythonStream_name (PythonStream *self) |
static method returning name representation of this type | |
static PyObject * | PythonStream_fileno (PythonStream *self) |
static PyObject * | PythonStream_write (PythonStream *self, PyObject *args) |
static method invoked if string has been written to stream | |
static PyObject * | PythonStream_flush (PythonStream *self, PyObject *args) |
static method is invoked if stream has been flushed | |
static PyObject * | PythonStream_readline (PythonStream *self, PyObject *args) |
Static Public Attributes | |
static PyMemberDef | PythonStream_members [] |
static PyMemberDef table which describes every member of PyStream type | |
static PyMethodDef | PythonStream_methods [] |
static table of type PyMethodDef which contains function pointers and descriptions to all methods, belonging to this type | |
static PyTypeObject | PythonStreamType |
static PyTypeObject for type PyStream with function pointers to all required static methods. | |
static PyModuleDef | pythonStreamModule |
PyModuleDef table, containing description for PyStream type. |
static class which implements a new python type. The members cout and cerr of the python system are set to variables of this type PyStream in order to observe the python's cout and cerr stream and to transmit the stream's content to the main application.
PyObject * ito::PyStream::PythonStream_flush | ( | PythonStream * | self, |
PyObject * | args | ||
) | [static] |
static method is invoked if stream has been flushed
stream is flushed if python is destroyed. Must return Py_None.
PyObject * ito::PyStream::PythonStream_write | ( | PythonStream * | self, |
PyObject * | args | ||
) | [static] |
static method invoked if string has been written to stream
string is contained in args reference and then sent to std::cout or std::cerr-stream, depending on value of member type.
PyMemberDef ito::PyStream::PythonStream_members [static] |
{ {"type", T_INT, offsetof(PyStream::PythonStream, type), READONLY, "PythonStream type"}, {"encoding", T_OBJECT_EX, offsetof(PyStream::PythonStream, encoding), READONLY, "Encoding of stream"}, {"closed", T_BOOL, offsetof(PyStream::PythonStream, closed), READONLY, "Indicates if stream is closed"}, {NULL} }
static PyMemberDef table which describes every member of PyStream type
PyMethodDef ito::PyStream::PythonStream_methods [static] |
{ {"name", (PyCFunction)PyStream::PythonStream_name, METH_NOARGS, "name"}, {"write", (PyCFunction)PyStream::PythonStream_write, METH_VARARGS, "write function"}, {"flush", (PyCFunction)PyStream::PythonStream_flush, METH_VARARGS, "flush function"}, { "readline", (PyCFunction)PyStream::PythonStream_readline, METH_VARARGS, "readline function" }, {"fileno", (PyCFunction)PyStream::PythonStream_fileno, METH_NOARGS, "returns the virtual file number of this stream (0: in [not supported yet], 1: out, 2: err, 3: in)"}, {NULL} }
static table of type PyMethodDef which contains function pointers and descriptions to all methods, belonging to this type
PyModuleDef ito::PyStream::pythonStreamModule [static] |
{ PyModuleDef_HEAD_INIT, "pythonStream", "Example module that creates an extension type.", -1, NULL, NULL, NULL, NULL, NULL }
PyModuleDef table, containing description for PyStream type.