ROPO
Loading...
Searching...
No Matches
pyropogenerator.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2011 Swedish Meteorological and Hydrological Institute, SMHI,
3
4This file is part of bRopo.
5
6bRopo 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
11bRopo 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 bRopo. If not, see <http://www.gnu.org/licenses/>.
18------------------------------------------------------------------------*/
25#ifndef PYROPOGENERATOR_H
26#define PYROPOGENERATOR_H
27#include "rave_ropo_generator.h"
28
32typedef struct {
33 PyObject_HEAD /*Always have to be on top*/
36
37#define PyRopoGenerator_Type_NUM 0
39#define PyRopoGenerator_GetNative_NUM 1
40#define PyRopoGenerator_GetNative_RETURN RaveRopoGenerator_t*
41#define PyRopoGenerator_GetNative_PROTO (PyRopoGenerator*)
43#define PyRopoGenerator_New_NUM 2
44#define PyRopoGenerator_New_RETURN PyRopoGenerator*
45#define PyRopoGenerator_New_PROTO (RaveRopoGenerator_t*, RaveFmiImage_t*)
47#define PyRopoGenerator_API_pointers 3
49#define PyRopoGenerator_CAPSULE_NAME "_fmiimage._C_API"
50
51#ifdef PYROPOGENERATOR_MODULE
53extern PyTypeObject PyRopoGenerator_Type;
54
56#define PyRopoGenerator_Check(op) ((op)->ob_type == &PyRopoGenerator_Type)
57
60
63
64#else
66static void **PyRopoGenerator_API;
67
72#define PyRopoGenerator_GetNative \
73 (*(PyRopoGenerator_GetNative_RETURN (*)PyRopoGenerator_GetNative_PROTO) PyRopoGenerator_API[PyRopoGenerator_GetNative_NUM])
74
83#define PyRopoGenerator_New \
84 (*(PyRopoGenerator_New_RETURN (*)PyRopoGenerator_New_PROTO) PyRopoGenerator_API[PyRopoGenerator_New_NUM])
85
89#define PyRopoGenerator_Check(op) \
90 (Py_TYPE(op) == &PyRopoGenerator_Type)
91
92#define PyRopoGenerator_Type (*(PyTypeObject*)PyRopoGenerator_API[PyRopoGenerator_Type_NUM])
93
97#define import_ropogenerator() \
98 PyRopoGenerator_API = (void **)PyCapsule_Import(PyRopoGenerator_CAPSULE_NAME, 1);
99
100#endif
101
102#endif /* PYROPOGENERATOR_H */
#define PyRopoGenerator_GetNative_PROTO
#define PyRopoGenerator_GetNative
#define PyRopoGenerator_New_RETURN
#define PyRopoGenerator_New_PROTO
#define PyRopoGenerator_GetNative_RETURN
#define PyRopoGenerator_New
PyObject_HEAD RaveRopoGenerator_t * generator