RAVE
pypolarnav.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 PYPOLARNAV_H
26#define PYPOLARNAV_H
27#include "polarnav.h"
28
32typedef struct {
33 PyObject_HEAD /*Always has to be on top*/
36
37#define PyPolarNavigator_Type_NUM 0
39#define PyPolarNavigator_GetNative_NUM 1
40#define PyPolarNavigator_GetNative_RETURN PolarNavigator_t*
41#define PyPolarNavigator_GetNative_PROTO (PyPolarNavigator*)
43#define PyPolarNavigator_New_NUM 2
44#define PyPolarNavigator_New_RETURN PyPolarNavigator*
45#define PyPolarNavigator_New_PROTO (PolarNavigator_t*)
47#define PyPolarNavigator_API_pointers 3
49#define PyPolarNavigator_CAPSULE_NAME "_polarnav._C_API"
50
51#ifdef PYPOLARNAV_MODULE
53extern PyTypeObject PyPolarNavigator_Type;
54
56#define PyPolarNavigator_Check(op) ((op)->ob_type == &PyPolarNavigator_Type)
57
60
63
64#else
66static void **PyPolarNavigator_API;
67
72#define PyPolarNavigator_GetNative \
73 (*(PyPolarNavigator_GetNative_RETURN (*)PyPolarNavigator_GetNative_PROTO) PyPolarNavigator_API[PyPolarNavigator_GetNative_NUM])
74
82#define PyPolarNavigator_New \
83 (*(PyPolarNavigator_New_RETURN (*)PyPolarNavigator_New_PROTO) PyPolarNavigator_API[PyPolarNavigator_New_NUM])
84
85
89#define PyPolarNavigator_Check(op) \
90 (Py_TYPE(op) == &PyPolarNavigator_Type)
91
92#define PyPolarNavigator_Type (*(PyTypeObject*)PyPolarNavigator_API[PyPolarNavigator_Type_NUM])
93
97#define import_pypolarnav() \
98 PyPolarNavigator_API = (void **)PyCapsule_Import(PyPolarNavigator_CAPSULE_NAME, 1);
99
100#endif
101
102
103#endif /* PYPOLARNAV_H */
Utilities for performing polar navigation.
#define PyPolarNavigator_New_PROTO
arguments for New
Definition pypolarnav.h:45
#define PyPolarNavigator_GetNative_RETURN
return type for GetNative
Definition pypolarnav.h:40
#define PyPolarNavigator_New
Creates a new polar scan instance.
Definition pypolarnav.h:82
#define PyPolarNavigator_GetNative
Returns a pointer to the internal polar navigator, remember to release the reference when done with t...
Definition pypolarnav.h:72
#define PyPolarNavigator_GetNative_PROTO
arguments for GetNative
Definition pypolarnav.h:41
#define PyPolarNavigator_New_RETURN
return type for New
Definition pypolarnav.h:44
A polar navigator.
Definition pypolarnav.h:32
PyObject_HEAD PolarNavigator_t * navigator
the polar navigator
Definition pypolarnav.h:34
Represents one polar navigator.
Definition polarnav.c:44