BEAM BLOCKAGE
pybbtopography.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 PYBBTOPOGRAPHY_H
26#define PYBBTOPOGRAPHY_H
27#include "Python.h"
28#include "bbtopography.h"
29
33typedef struct {
34 PyObject_HEAD /*Always have to be on top*/
37
38#define PyBBTopography_Type_NUM 0
40#define PyBBTopography_GetNative_NUM 1
41#define PyBBTopography_GetNative_RETURN BBTopography_t*
42#define PyBBTopography_GetNative_PROTO (PyBBTopography*)
44#define PyBBTopography_New_NUM 2
45#define PyBBTopography_New_RETURN PyBBTopography*
46#define PyBBTopography_New_PROTO (BBTopography_t*)
48#define PyBBTopography_API_pointers 3
50#define PyBBTopography_CAPSULE_NAME "_bbtopography._C_API"
51
52#ifdef PYBBTOPOGRAPHY_MODULE
54extern PyTypeObject PyBBTopography_Type;
55
57#define PyBBTopography_Check(op) ((op)->ob_type == &PyBBTopography_Type)
58
61
64
65#else
67static void **PyBBTopography_API;
68
73#define PyBBTopography_GetNative \
74 (*(PyBBTopography_GetNative_RETURN (*)PyBBTopography_GetNative_PROTO) PyBBTopography_API[PyBBTopography_GetNative_NUM])
75
83#define PyBBTopography_New \
84 (*(PyBBTopography_New_RETURN (*)PyBBTopography_New_PROTO) PyBBTopography_API[PyBBTopography_New_NUM])
85
89#define PyBBTopography_Check(op) \
90 (Py_TYPE(op) == &PyBBTopography_Type)
91
92#define PyBBTopography_Type (*(PyTypeObject*)PyBBTopography_API[PyBBTopography_Type_NUM])
93
97#define import_bbtopography() \
98 PyBBTopography_API = (void **)PyCapsule_Import(PyBBTopography_CAPSULE_NAME, 1);
99
100#endif
101
102#endif /* PYBBTOPOGRAPHY_H */
Beam-blockage topography field.
#define PyBBTopography_New
Creates a new instance.
Definition pybbtopography.h:83
#define PyBBTopography_New_RETURN
return type for New
Definition pybbtopography.h:45
#define PyBBTopography_GetNative_PROTO
arguments for GetNative
Definition pybbtopography.h:42
#define PyBBTopography_New_PROTO
arguments for New
Definition pybbtopography.h:46
#define PyBBTopography_GetNative_RETURN
return type for GetNative
Definition pybbtopography.h:41
#define PyBBTopography_GetNative
Returns a pointer to the internal object, remember to release the reference when done with the object...
Definition pybbtopography.h:73
The beam blockage.
Definition pybbtopography.h:33
PyObject_HEAD BBTopography_t * topo
the native object
Definition pybbtopography.h:35
Represents the beam blockage topography.
Definition bbtopography.c:34