RAVE
pycartesianvolume.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2010 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 PYCARTESIANVOLUME_H
26#define PYCARTESIANVOLUME_H
27#include "cartesianvolume.h"
28
32typedef struct {
33 PyObject_HEAD /*Always have to be on top*/
36
37#define PyCartesianVolume_Type_NUM 0
39#define PyCartesianVolume_GetNative_NUM 1
40#define PyCartesianVolume_GetNative_RETURN CartesianVolume_t*
41#define PyCartesianVolume_GetNative_PROTO (PyCartesianVolume*)
43#define PyCartesianVolume_New_NUM 2
44#define PyCartesianVolume_New_RETURN PyCartesianVolume*
45#define PyCartesianVolume_New_PROTO (CartesianVolume_t*)
47#define PyCartesianVolume_API_pointers 3
49#define PyCartesianVolume_CAPSULE_NAME "_cartesianvolume._C_API"
50
51#ifdef PYCARTESIANVOLUME_MODULE
53extern PyTypeObject PyCartesianVolume_Type;
54
56#define PyCartesianVolume_Check(op) ((op)->ob_type == &PyCartesianVolume_Type)
57
60
63
64#else
66static void **PyCartesianVolume_API;
67
72#define PyCartesianVolume_GetNative \
73 (*(PyCartesianVolume_GetNative_RETURN (*)PyCartesianVolume_GetNative_PROTO) PyCartesianVolume_API[PyCartesianVolume_GetNative_NUM])
74
82#define PyCartesianVolume_New \
83 (*(PyCartesianVolume_New_RETURN (*)PyCartesianVolume_New_PROTO) PyCartesianVolume_API[PyCartesianVolume_New_NUM])
84
85
89#define PyCartesianVolume_Check(op) \
90 (Py_TYPE(op) == &PyCartesianVolume_Type)
91
92#define PyCartesianVolume_Type (*(PyTypeObject*)PyCartesianVolume_API[PyCartesianVolume_Type_NUM])
93
97#define import_pycartesianvolume() \
98 PyCartesianVolume_API = (void **)PyCapsule_Import(PyCartesianVolume_CAPSULE_NAME, 1);
99
100#endif
101
102#endif /* PYCARTESIANVOLUME_H */
Defines the functions available when working with cartesian volumes.
#define PyCartesianVolume_GetNative_PROTO
arguments for GetNative
Definition pycartesianvolume.h:41
#define PyCartesianVolume_New
Creates a new cartesian volume instance.
Definition pycartesianvolume.h:82
#define PyCartesianVolume_GetNative_RETURN
return type for GetNative
Definition pycartesianvolume.h:40
#define PyCartesianVolume_New_RETURN
return type for New
Definition pycartesianvolume.h:44
#define PyCartesianVolume_GetNative
Returns a pointer to the internal cartesian volume, remember to release the reference when done with ...
Definition pycartesianvolume.h:72
#define PyCartesianVolume_New_PROTO
arguments for New
Definition pycartesianvolume.h:45
The cartesian volume object.
Definition pycartesianvolume.h:32
PyObject_HEAD CartesianVolume_t * cvol
the cartesian volume
Definition pycartesianvolume.h:34
Represents the cartesian volume.
Definition cartesianvolume.c:39