itom 1.0.14
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 //python
00031 // see http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=7f3f750596a105d48ea84ebfe1b1c4ca03e0bab3
00032 #ifdef _DEBUG
00033     #undef _DEBUG
00034     #if (defined linux) | (defined CMAKE)
00035         #include "Python.h"
00036     #else
00037         #include "Python.h"
00038     #endif
00039     #define _DEBUG
00040 #else
00041     #ifdef linux
00042         #include "Python.h"
00043     #else
00044         #include "Python.h"
00045     #endif
00046 #endif
00047 
00048 
00049 class PyStream
00050 {
00051 
00052 public:
00053 
00055     /*
00056         The struct's name is PythonStream. This python type consists of the basic elements for every python type,
00057         included an integer value type, which indicates whether this stream corresponds to the stream \a cout or \a cerr.
00058     */
00059     typedef struct 
00060     {
00061         PyObject_HEAD
00062         int type;   
00063     } 
00064     PythonStream;
00065 
00066     static void PythonStream_dealloc(PythonStream* self);
00067     //static PyObject *PythonStream_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
00068     static int PythonStream_init(PythonStream *self, PyObject *args, PyObject *kwds);
00069 
00070     static PyObject *PythonStream_name(PythonStream* self);
00071     static PyObject *PythonStream_write(PythonStream* self, PyObject *args);
00072     static PyObject *PythonStream_flush(PythonStream* self, PyObject *args);
00073     
00074     static PyMemberDef PythonStream_members[];
00075     static PyMethodDef PythonStream_methods[];
00076     static PyTypeObject PythonStreamType;
00077     static PyModuleDef pythonStreamModule;
00078 };
00079 
00080 
00081 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends