RAVE
pydetectionrange.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2011 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 PYDETECTIONRANGE_H
26#define PYDETECTIONRANGE_H
27#include "detection_range.h"
28
32typedef struct {
33 PyObject_HEAD /*Always has to be on top*/
36
37#define PyDetectionRange_Type_NUM 0
39#define PyDetectionRange_GetNative_NUM 1
40#define PyDetectionRange_GetNative_RETURN DetectionRange_t*
41#define PyDetectionRange_GetNative_PROTO (PyDetectionRange*)
43#define PyDetectionRange_New_NUM 2
44#define PyDetectionRange_New_RETURN PyDetectionRange*
45#define PyDetectionRange_New_PROTO (DetectionRange_t*)
47#define PyDetectionRange_API_pointers 3
49#define PyDetectionRange_CAPSULE_NAME "_detectionrange._C_API"
50
51#ifdef PYDETECTIONRANGE_MODULE
53extern PyTypeObject PyDetectionRange_Type;
54
56#define PyDetectionRange_Check(op) ((op)->ob_type == &PyDetectionRange_Type)
57
60
63
64#else
66static void **PyDetectionRange_API;
67
72#define PyDetectionRange_GetNative \
73 (*(PyDetectionRange_GetNative_RETURN (*)PyDetectionRange_GetNative_PROTO) PyDetectionRange_API[PyDetectionRange_GetNative_NUM])
74
82#define PyDetectionRange_New \
83 (*(PyDetectionRange_New_RETURN (*)PyDetectionRange_New_PROTO) PyDetectionRange_API[PyDetectionRange_New_NUM])
84
88#define PyDetectionRange_Check(op) \
89 (Py_TYPE(op) == &PyDetectionRange_Type)
90
91#define PyDetectionRange_Type (*(PyTypeObject*)PyDetectionRange_API[PyDetectionRange_Type_NUM])
92
96#define import_detectionrange() \
97 PyArea_API = (void **)PyCapsule_Import(PyDetectionRange_CAPSULE_NAME, 1);
98
99
100#define PyDetectionRange_Check(op) \
101 ((op)->ob_type == (PyTypeObject *)PyDetectionRange_API[PyDetectionRange_Type_NUM])
102
103
104#endif
105
106
107
108#endif /* PYCOMPOSITE_H */
Provides functionality for creating composites.
#define PyDetectionRange_GetNative_RETURN
return type for GetNative
Definition pydetectionrange.h:40
#define PyDetectionRange_New_PROTO
arguments for New
Definition pydetectionrange.h:45
#define PyDetectionRange_New_RETURN
return type for New
Definition pydetectionrange.h:44
#define PyDetectionRange_GetNative
Returns a pointer to the internal detection range, remember to release the reference when done with t...
Definition pydetectionrange.h:72
#define PyDetectionRange_New
Creates a new detection range instance.
Definition pydetectionrange.h:82
#define PyDetectionRange_GetNative_PROTO
arguments for GetNative
Definition pydetectionrange.h:41
A detection range generator.
Definition pydetectionrange.h:32
PyObject_HEAD DetectionRange_t * dr
the detection range generator
Definition pydetectionrange.h:34
Represents the detection range generator.
Definition detection_range.c:47