RAVE
pyverticalprofile.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------------------------------------------------------------------------*/
26#ifndef PYVERTICALPROFILE_H
27#define PYVERTICALPROFILE_H
28#include "vertical_profile.h"
29#include <Python.h>
30
34typedef struct {
35 PyObject_HEAD /*Always has to be on top*/
38
39#define PyVerticalProfile_Type_NUM 0
41#define PyVerticalProfile_GetNative_NUM 1
42#define PyVerticalProfile_GetNative_RETURN VerticalProfile_t*
43#define PyVerticalProfile_GetNative_PROTO (PyVerticalProfile*)
45#define PyVerticalProfile_New_NUM 2
46#define PyVerticalProfile_New_RETURN PyVerticalProfile*
47#define PyVerticalProfile_New_PROTO (VerticalProfile_t*)
49#define PyVerticalProfile_API_pointers 3
51#define PyVerticalProfile_CAPSULE_NAME "_verticalprofile._C_API"
52
53#ifdef PYVERTICALPROFILE_MODULE
55extern PyTypeObject PyVerticalProfile_Type;
56
58#define PyVerticalProfile_Check(op) ((op)->ob_type == &PyVerticalProfile_Type)
59
62
65
66#else
68static void **PyVerticalProfile_API;
69
74#define PyVerticalProfile_GetNative \
75 (*(PyVerticalProfile_GetNative_RETURN (*)PyVerticalProfile_GetNative_PROTO) PyVerticalProfile_API[PyVerticalProfile_GetNative_NUM])
76
84#define PyVerticalProfile_New \
85 (*(PyVerticalProfile_New_RETURN (*)PyVerticalProfile_New_PROTO) PyVerticalProfile_API[PyVerticalProfile_New_NUM])
86
90#define PyVerticalProfile_Check(op) \
91 (Py_TYPE(op) == &PyVerticalProfile_Type)
92
93#define PyVerticalProfile_Type (*(PyTypeObject*)PyVerticalProfile_API[PyVerticalProfile_Type_NUM])
94
98#define import_pyverticalprofile() \
99 PyVerticalProfile_API = (void **)PyCapsule_Import(PyVerticalProfile_CAPSULE_NAME, 1);
100
101#endif
102
103
104
105
106#endif /* PYVERTICALPROFILE_H_ */
#define PyVerticalProfile_GetNative_PROTO
arguments for GetNative
Definition pyverticalprofile.h:43
#define PyVerticalProfile_GetNative
Returns a pointer to the internal vertical profile, remember to release the reference when done with ...
Definition pyverticalprofile.h:74
#define PyVerticalProfile_GetNative_RETURN
return type for GetNative
Definition pyverticalprofile.h:42
#define PyVerticalProfile_New
Creates a new vertical profile instance.
Definition pyverticalprofile.h:84
#define PyVerticalProfile_New_PROTO
arguments for New
Definition pyverticalprofile.h:47
#define PyVerticalProfile_New_RETURN
return type for New
Definition pyverticalprofile.h:46
A generic vertical profile.
Definition pyverticalprofile.h:34
PyObject_HEAD VerticalProfile_t * vp
the vertical profile type
Definition pyverticalprofile.h:36
Represents one vertical profile.
Definition vertical_profile.c:46
Defines the functions available when working with vertical profiles.