itom  4.1.0
pythonProxy.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #ifndef PYTHONPROXY_H
24 #define PYTHONPROXY_H
25 
26 /* includes */
27 #ifndef Q_MOC_RUN
28  #define PY_ARRAY_UNIQUE_SYMBOL itom_ARRAY_API //see numpy help ::array api :: Miscellaneous :: Importing the api (this line must bebefore include global.h)
29  #define NO_IMPORT_ARRAY
30 
31  //python
32  // see http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=7f3f750596a105d48ea84ebfe1b1c4ca03e0bab3
33  #if (defined _DEBUG) && (defined WIN32)
34  #undef _DEBUG
35  #include "python/pythonWrapper.h"
36  #define _DEBUG
37  #else
38  #include "python/pythonWrapper.h"
39  #endif
40 #endif
41 
42 namespace ito
43 {
44 
46 {
47 public:
48  typedef struct
49  {
50  PyObject_HEAD
51  PyObject* inst;
52  PyObject* func;
53  PyObject* klass;
54  PyObject* base;
55  }
56  PyProxy;
57 
58  //-------------------------------------------------------------------------------------------------
59  // constructor, deconstructor, alloc, dellaoc
60  //-------------------------------------------------------------------------------------------------
61  static void PyProxy_dealloc(PyProxy *self);
62  static PyObject* PyProxy_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
63  static int PyProxy_init(PyProxy *self, PyObject *args, PyObject *kwds);
64 
65 
66  static PyObject *PyProxy_richcompare(PyObject *v, PyObject *w, int op);
67  static PyObject *PyProxy_call(PyProxy *self, PyObject *args, PyObject *kwds);
68 
69  //-------------------------------------------------------------------------------------------------
70  // type structures
71  //-------------------------------------------------------------------------------------------------
72  static PyTypeObject PyProxyType;
73  static PyModuleDef PyProxyModule;
74 
75  static void PyProxy_addTpDict(PyObject *tp_dict);
76 };
77 
78 }; //end namespace ito
79 
80 
81 #endif
Definition: pythonProxy.h:48
Definition: apiFunctionsGraph.cpp:39
Definition: pythonProxy.h:45