BEAM BLOCKAGE
pybeamblockage.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2011 Swedish Meteorological and Hydrological Institute, SMHI,
3
4This file is part of beamb.
5
6beamb 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
11beamb 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 beamb. If not, see <http://www.gnu.org/licenses/>.
18------------------------------------------------------------------------*/
25#ifndef PYBEAMBLOCKAGE_H
26#define PYBEAMBLOCKAGE_H
27#include "beamblockage.h"
28
32typedef struct {
33 PyObject_HEAD /*Always have to be on top*/
36
37#define PyBeamBlockage_Type_NUM 0
39#define PyBeamBlockage_GetNative_NUM 1
40#define PyBeamBlockage_GetNative_RETURN BeamBlockage_t*
41#define PyBeamBlockage_GetNative_PROTO (PyBeamBlockage*)
43#define PyBeamBlockage_New_NUM 2
44#define PyBeamBlockage_New_RETURN PyBeamBlockage*
45#define PyBeamBlockage_New_PROTO (BeamBlockage_t*)
47#define PyBeamBlockage_API_pointers 3
49#define PyBeamBlockage_CAPSULE_NAME "_beamblockage._C_API"
50
51#ifdef PYBEAMBLOCKAGE_MODULE
53extern PyTypeObject PyBeamBlockage_Type;
54
56#define PyBeamBlockage_Check(op) ((op)->ob_type == &PyBeamBlockage_Type)
57
60
63
64#else
66static void **PyBeamBlockage_API;
67
72#define PyBeamBlockage_GetNative \
73 (*(PyBeamBlockage_GetNative_RETURN (*)PyBeamBlockage_GetNative_PROTO) PyBeamBlockage_API[PyBeamBlockage_GetNative_NUM])
74
82#define PyBeamBlockage_New \
83 (*(PyBeamBlockage_New_RETURN (*)PyBeamBlockage_New_PROTO) PyBeamBlockage_API[PyBeamBlockage_New_NUM])
84
88#define PyBeamBlockage_Check(op) \
89 (Py_TYPE(op) == &PyBeamBlockage_Type)
90
91
92#define PyBeamBlockage_Type (*(PyTypeObject*)PyBeamBlockage_API[PyBeamBlockage_Type_NUM])
93
94
98#define import_beamblockage() \
99 PyBeamBlockage_API = (void **)PyCapsule_Import(PyBeamBlockage_CAPSULE_NAME, 1);
100
101#endif
102
103#endif /* PYBEAMBLOCKAGE_H */
Beam-blockage analysis.
#define PyBeamBlockage_GetNative_RETURN
return type for GetNative
Definition pybeamblockage.h:40
#define PyBeamBlockage_New
Creates a new beam blockage instance.
Definition pybeamblockage.h:82
#define PyBeamBlockage_New_RETURN
return type for New
Definition pybeamblockage.h:44
#define PyBeamBlockage_GetNative
Returns a pointer to the internal beam blockage, remember to release the reference when done with the...
Definition pybeamblockage.h:72
#define PyBeamBlockage_GetNative_PROTO
arguments for GetNative
Definition pybeamblockage.h:41
#define PyBeamBlockage_New_PROTO
arguments for New
Definition pybeamblockage.h:45
The beam blockage.
Definition pybeamblockage.h:32
PyObject_HEAD BeamBlockage_t * beamb
the native object
Definition pybeamblockage.h:34
Represents the beam blockage algorithm.
Definition beamblockage.c:43