RAVE
pyravelegend.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 PYRAVELEGEND_H
26#define PYRAVELEGEND_H
27#include "rave_legend.h"
28
32typedef struct {
33 PyObject_HEAD /*Always have to be on top*/
36
37#define PyRaveLegend_Type_NUM 0
39#define PyRaveLegend_GetNative_NUM 1
40#define PyRaveLegend_GetNative_RETURN RaveLegend_t*
41#define PyRaveLegend_GetNative_PROTO (PyRaveLegend*)
43#define PyRaveLegend_New_NUM 2
44#define PyRaveLegend_New_RETURN PyRaveLegend*
45#define PyRaveLegend_New_PROTO (RaveLegend_t*)
47#define PyRaveLegend_API_pointers 3
49#define PyRaveLegend_CAPSULE_NAME "_ravelegend._C_API"
50
51#ifdef PYRAVELEGEND_MODULE
53extern PyTypeObject PyRaveLegend_Type;
54
56#define PyRaveLegend_Check(op) ((op)->ob_type == &PyRaveLegend_Type)
57
60
63
64#else
66static void **PyRaveLegend_API;
67
72#define PyRaveLegend_GetNative \
73 (*(PyRaveLegend_GetNative_RETURN (*)PyRaveLegend_GetNative_PROTO) PyRaveLegend_API[PyRaveLegend_GetNative_NUM])
74
82#define PyRaveLegend_New \
83 (*(PyRaveLegend_New_RETURN (*)PyRaveLegend_New_PROTO) PyRaveLegend_API[PyRaveLegend_New_NUM])
84
88#define PyRaveLegend_Check(op) \
89 (Py_TYPE(op) == &PyRaveLegend_Type)
90
91#define PyRaveLegend_Type (*(PyTypeObject*)PyRaveLegend_API[PyRaveLegend_Type_NUM])
92
96#define import_pyravelegend() \
97 PyRaveLegend_API = (void **)PyCapsule_Import(PyRaveLegend_CAPSULE_NAME, 1);
98
99#endif
100
101
102#endif /* PYRAVELEGEND_H */
#define PyRaveLegend_GetNative_RETURN
return type for GetNative
Definition pyravelegend.h:40
#define PyRaveLegend_New
Creates a new rave legend instance.
Definition pyravelegend.h:82
#define PyRaveLegend_GetNative_PROTO
arguments for GetNative
Definition pyravelegend.h:41
#define PyRaveLegend_GetNative
Returns a pointer to the internal legend, remember to release the reference when done with the object...
Definition pyravelegend.h:72
#define PyRaveLegend_New_PROTO
arguments for New
Definition pyravelegend.h:45
#define PyRaveLegend_New_RETURN
return type for New
Definition pyravelegend.h:44
Used for defining a legend that can be added to a parameter.
The rave field object.
Definition pyravelegend.h:32
PyObject_HEAD RaveLegend_t * legend
the rave legend
Definition pyravelegend.h:34
Represents one scan in a volume.
Definition rave_legend.c:39