itom 2.0.0
PyStream Class Reference

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...

List of all members.

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 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.

Detailed Description

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.


Member Function Documentation

PyObject * 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.

Returns:
PyNone
PyObject * 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.

Returns:
PyNone

Member Data Documentation

PyMemberDef PyStream::PythonStream_members [static]
Initial value:
 {
    {"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 PyStream::PythonStream_methods [static]
Initial value:
 {
    {"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"},
    {"fileno", (PyCFunction)PyStream::PythonStream_fileno, METH_NOARGS, "returns the virtual file number of this stream (0: in [not supported yet], 1: out, 2: err)"},
    {NULL}  
}

static table of type PyMethodDef which contains function pointers and descriptions to all methods, belonging to this type

PyModuleDef PyStream::pythonStreamModule [static]
Initial value:
 {
    PyModuleDef_HEAD_INIT,
    "pythonStream",
    "Example module that creates an extension type.",
    -1,
    NULL, NULL, NULL, NULL, NULL
}

PyModuleDef table, containing description for PyStream type.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends