RAVE
pyqitotal.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2009 Swedish Meteorological and Hydrological Institute, SMHI,
3
4This file is part of RAVE.
5
6RAVE is free software: you can redistribute it and/or modify
7it under the terms of the GNU Lesser General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11RAVE is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU Lesser General Public License for more details.
15
16You should have received a copy of the GNU Lesser General Public License
17along with RAVE. If not, see <http://www.gnu.org/licenses/>.
18------------------------------------------------------------------------*/
25#ifndef PYQITOTAL_H
26#define PYQITOTAL_H
27#include "rave_qitotal.h"
28
32typedef struct {
33 PyObject_HEAD /*Always has to be on top*/
35} PyQITotal;
36
37#define PyQITotal_Type_NUM 0
39#define PyQITotal_GetNative_NUM 1
40#define PyQITotal_GetNative_RETURN RaveQITotal_t*
41#define PyQITotal_GetNative_PROTO (PyQITotal*)
43#define PyQITotal_New_NUM 2
44#define PyQITotal_New_RETURN PyQITotal*
45#define PyQITotal_New_PROTO (RaveQITotal_t*)
47#define PyQITotal_API_pointers 3
49#define PyQITotal_CAPSULE_NAME "_qitotal._C_API"
50
51#ifdef PYQITOTAL_MODULE
53extern PyTypeObject PyQITotal_Type;
54
56#define PyQITotal_Check(op) ((op)->ob_type == &PyQITotal_Type)
57
62
67
68#else
70static void **PyQITotal_API;
71
76#define PyQITotal_GetNative \
77 (*(PyQITotal_GetNative_RETURN (*)PyQITotal_GetNative_PROTO) PyQITotal_API[PyQITotal_GetNative_NUM])
78
85#define PyQITotal_New \
86 (*(PyQITotal_New_RETURN (*)PyQITotal_New_PROTO) PyQITotal_API[PyQITotal_New_NUM])
87
91#define PyQITotal_Check(op) \
92 (Py_TYPE(op) == &PyQITotal_Type)
93
94#define PyQITotal_Type (*(PyTypeObject*)PyQITotal_API[PyQITotal_Type_NUM])
95
99#define import_qitotal() \
100 PyQITotal_API = (void **)PyCapsule_Import(PyQITotal_CAPSULE_NAME, 1);
101
102
103#endif
104
105#endif /* PYQITOTAL_H */
#define PyQITotal_GetNative_PROTO
argument prototype for GetNative
Definition pyqitotal.h:41
#define PyQITotal_New_PROTO
argument prototype for New
Definition pyqitotal.h:45
#define PyQITotal_New_RETURN
return type for New
Definition pyqitotal.h:44
#define PyQITotal_GetNative
Returns a pointer to the internal qi total, remember to release the reference when done with the obje...
Definition pyqitotal.h:76
#define PyQITotal_GetNative_RETURN
return type for GetNative
Definition pyqitotal.h:40
#define PyQITotal_New
Creates a new qi total instance.
Definition pyqitotal.h:85
Implementation of the QI-total algorithm.
A qi total object.
Definition pyqitotal.h:32
PyObject_HEAD RaveQITotal_t * qitotal
The qi total algorithm.
Definition pyqitotal.h:34
Represents the QI total generator.
Definition rave_qitotal.c:35