RAVE
pypolarvolume.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 PYPOLARVOLUME_H
26#define PYPOLARVOLUME_H
27#include "polarvolume.h"
28
32typedef struct {
33 PyObject_HEAD /*Always have to be on top*/
36
37#define PyPolarVolume_Type_NUM 0
39#define PyPolarVolume_GetNative_NUM 1
40#define PyPolarVolume_GetNative_RETURN PolarVolume_t*
41#define PyPolarVolume_GetNative_PROTO (PyPolarVolume*)
43#define PyPolarVolume_New_NUM 2
44#define PyPolarVolume_New_RETURN PyPolarVolume*
45#define PyPolarVolume_New_PROTO (PolarVolume_t*)
47#define PyPolarVolume_API_pointers 3
49#define PyPolarVolume_CAPSULE_NAME "_polarvolume._C_API"
50
51#ifdef PYPOLARVOLUME_MODULE
53extern PyTypeObject PyPolarVolume_Type;
54
56#define PyPolarVolume_Check(op) ((op)->ob_type == &PyPolarVolume_Type)
57
60
63
64#else
66static void **PyPolarVolume_API;
67
72#define PyPolarVolume_GetNative \
73 (*(PyPolarVolume_GetNative_RETURN (*)PyPolarVolume_GetNative_PROTO) PyPolarVolume_API[PyPolarVolume_GetNative_NUM])
74
82#define PyPolarVolume_New \
83 (*(PyPolarVolume_New_RETURN (*)PyPolarVolume_New_PROTO) PyPolarVolume_API[PyPolarVolume_New_NUM])
84
88#define PyPolarVolume_Check(op) \
89 (Py_TYPE(op) == &PyPolarVolume_Type)
90
91#define PyPolarVolume_Type (*(PyTypeObject*)PyPolarVolume_API[PyPolarVolume_Type_NUM])
92
96#define import_pypolarvolume() \
97 PyPolarVolume_API = (void **)PyCapsule_Import(PyPolarVolume_CAPSULE_NAME, 1);
98
99#endif
100
101#endif /* PYPOLARVOLUME_H */
Defines the functions available when working with polar volumes.
#define PyPolarVolume_GetNative_RETURN
return type for GetNative
Definition pypolarvolume.h:40
#define PyPolarVolume_New_RETURN
return type for New
Definition pypolarvolume.h:44
#define PyPolarVolume_New
Creates a new polar volume instance.
Definition pypolarvolume.h:82
#define PyPolarVolume_GetNative_PROTO
arguments for GetNative
Definition pypolarvolume.h:41
#define PyPolarVolume_New_PROTO
arguments for New
Definition pypolarvolume.h:45
#define PyPolarVolume_GetNative
Returns a pointer to the internal polar volume, remember to release the reference when done with the ...
Definition pypolarvolume.h:72
The polar volume object.
Definition pypolarvolume.h:32
PyObject_HEAD PolarVolume_t * pvol
the polar volume
Definition pypolarvolume.h:34
Represents a volume.
Definition polarvolume.c:51