itom 2.0.0
D:/git-itom/sources/itom/Qitom/python/pythonStream.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2013, Institut für Technische Optik (ITO),
00005     Universität Stuttgart, Germany
00006 
00007     This file is part of itom.
00008   
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013 
00014     itom is distributed in the hope that it will be useful, but
00015     WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00017     General Public Licence for more details.
00018 
00019     You should have received a copy of the GNU Library General Public License
00020     along with itom. If not, see <http://www.gnu.org/licenses/>.
00021 *********************************************************************** */
00022 
00023 //###################
00024 //# pythonStream.h  #
00025 //###################
00026 
00027 #ifndef PYTHONSTREAM_H
00028 #define PYTHONSTREAM_H
00029 
00030 #ifndef Q_MOC_RUN
00031     //python
00032     // see http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=7f3f750596a105d48ea84ebfe1b1c4ca03e0bab3
00033     #if (defined _DEBUG) && (defined WIN32)
00034         #undef _DEBUG
00035         #include "Python.h"
00036         #define _DEBUG
00037     #else
00038         #include "Python.h"
00039     #endif
00040 #endif
00041 
00042 
00043 class PyStream
00044 {
00045 
00046 public:
00047 
00049     /*
00050         The struct's name is PythonStream. This python type consists of the basic elements for every python type,
00051         included an integer value type, which indicates whether this stream corresponds to the stream \a cout or \a cerr.
00052     */
00053     typedef struct 
00054     {
00055         PyObject_HEAD
00056         int type;   
00057         PyObject *encoding;
00058         char closed;
00059     } 
00060     PythonStream;
00061 
00062     static void PythonStream_dealloc(PythonStream* self);
00063     //static PyObject *PythonStream_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
00064     static int PythonStream_init(PythonStream *self, PyObject *args, PyObject *kwds);
00065 
00066     static PyObject *PythonStream_name(PythonStream* self);
00067     static PyObject *PythonStream_fileno(PythonStream* self);
00068     static PyObject *PythonStream_write(PythonStream* self, PyObject *args);
00069     static PyObject *PythonStream_flush(PythonStream* self, PyObject *args);
00070     
00071     static PyMemberDef PythonStream_members[];
00072     static PyMethodDef PythonStream_methods[];
00073     static PyTypeObject PythonStreamType;
00074     static PyModuleDef pythonStreamModule;
00075 };
00076 
00077 
00078 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends