RAVE
pyacrr.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2012 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 PYACRR_H
26#define PYACRR_H
27#include "Python.h"
28#include "rave_acrr.h"
29
33typedef struct {
34 PyObject_HEAD /*Always has to be on top*/
36} PyAcrr;
37
38#define PyAcrr_Type_NUM 0
40#define PyAcrr_GetNative_NUM 1
41#define PyAcrr_GetNative_RETURN RaveAcrr_t*
42#define PyAcrr_GetNative_PROTO (PyAcrr*)
44#define PyAcrr_New_NUM 2
45#define PyAcrr_New_RETURN PyAcrr*
46#define PyAcrr_New_PROTO (RaveAcrr_t*)
48#define PyAcrr_API_pointers 3
50#define PyAcrr_CAPSULE_NAME "_acrr._C_API"
51
52#ifdef PYACRR_MODULE
54extern PyTypeObject PyAcrr_Type;
55
57#define PyAcrr_Check(op) ((op)->ob_type == &PyAcrr_Type)
58
61
64
65#else
67static void **PyAcrr_API;
68
73#define PyAcrr_GetNative \
74 (*(PyAcrr_GetNative_RETURN (*)PyAcrr_GetNative_PROTO) PyAcrr_API[PyAcrr_GetNative_NUM])
75
83#define PyAcrr_New \
84 (*(PyAcrr_New_RETURN (*)PyAcrr_New_PROTO) PyAcrr_API[PyAcrr_New_NUM])
85
89#define PyAcrr_Check(op) \
90 (Py_TYPE(op) == &PyAcrr_Type)
91
92#define PyAcrr_Type (*(PyTypeObject*)PyAcrr_API[PyAcrr_Type_NUM])
93
97#define import_pyacrr() \
98 PyAcrr_API = (void **)PyCapsule_Import(PyAcrr_CAPSULE_NAME, 1);
99
100
101#endif
102
103#endif /* PYACRR_H */
#define PyAcrr_New_RETURN
return type for New
Definition pyacrr.h:45
#define PyAcrr_New_PROTO
arguments for New
Definition pyacrr.h:46
#define PyAcrr_GetNative
Returns a pointer to the internal acrr, remember to release the reference when done with the object.
Definition pyacrr.h:73
#define PyAcrr_New
Creates a new polar scan instance.
Definition pyacrr.h:83
#define PyAcrr_GetNative_RETURN
return type for GetNative
Definition pyacrr.h:41
#define PyAcrr_GetNative_PROTO
arguments for GetNative
Definition pyacrr.h:42
Implementation of the Precipitation accumulation - ACRR algorithm.
A cartesian product.
Definition pyacrr.h:33
PyObject_HEAD RaveAcrr_t * acrr
the acrr
Definition pyacrr.h:35
Represents the acrr generator.
Definition rave_acrr.c:40