RAVE
pyravedata2d.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2009-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 PYRAVEDATA2D_H
26#define PYRAVEDATA2D_H
27#include "rave_data2d.h"
28
32typedef struct {
33 PyObject_HEAD /*Always have to be on top*/
36
37#define PyRaveData2D_Type_NUM 0
39#define PyRaveData2D_GetNative_NUM 1
40#define PyRaveData2D_GetNative_RETURN RaveData2D_t*
41#define PyRaveData2D_GetNative_PROTO (PyRaveData2D*)
43#define PyRaveData2D_New_NUM 2
44#define PyRaveData2D_New_RETURN PyRaveData2D*
45#define PyRaveData2D_New_PROTO (RaveData2D_t*)
47#define PyRaveData2D_API_pointers 3
49#define PyRaveData2D_CAPSULE_NAME "_ravedata2d._C_API"
50
51#ifdef PYRAVEDATA2D_MODULE
53extern PyTypeObject PyRaveData2D_Type;
54
56#define PyRaveData2D_Check(op) ((op)->ob_type == &PyRaveData2D_Type)
57
60
63
64#else
66static void **PyRaveData2D_API;
67
72#define PyRaveData2D_GetNative \
73 (*(PyRaveData2D_GetNative_RETURN (*)PyRaveData2D_GetNative_PROTO) PyRaveData2D_API[PyRaveData2D_GetNative_NUM])
74
82#define PyRaveData2D_New \
83 (*(PyRaveData2D_New_RETURN (*)PyRaveData2D_New_PROTO) PyRaveData2D_API[PyRaveData2D_New_NUM])
84
88#define PyRaveData2D_Check(op) \
89 (Py_TYPE(op) == &PyRaveData2D_Type)
90
91#define PyRaveData2D_Type (*(PyTypeObject*)PyRaveData2D_API[PyRaveData2D_Type_NUM])
92
96#define import_ravedata2d() \
97 PyRaveData2D_API = (void **)PyCapsule_Import(PyRaveData2D_CAPSULE_NAME, 1);
98
99#endif
100
101
102#endif /* PYRAVEDATA2D_H */
#define PyRaveData2D_New
Creates a new rave data 2d instance.
Definition pyravedata2d.h:82
#define PyRaveData2D_New_PROTO
arguments for New
Definition pyravedata2d.h:45
#define PyRaveData2D_GetNative
Returns a pointer to the internal field, remember to release the reference when done with the object.
Definition pyravedata2d.h:72
#define PyRaveData2D_New_RETURN
return type for New
Definition pyravedata2d.h:44
#define PyRaveData2D_GetNative_PROTO
arguments for GetNative
Definition pyravedata2d.h:41
#define PyRaveData2D_GetNative_RETURN
return type for GetNative
Definition pyravedata2d.h:40
Represents a 2-dimensional data array.
The rave field object.
Definition pyravedata2d.h:32
PyObject_HEAD RaveData2D_t * field
the rave data 2d array
Definition pyravedata2d.h:34
Represents a date time instance.
Definition rave_data2d.c:38