RAVE
pycompositefilter.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 PYCOMPOSITEFILTER_H
26#define PYCOMPOSITEFILTER_H
27#include "compositefilter.h"
28#include <Python.h>
29
33typedef struct {
34 PyObject_HEAD /*Always has to be on top*/
37
38#define PyCompositeFilter_Type_NUM 0
39
40#define PyCompositeFilter_GetNative_NUM 1
41#define PyCompositeFilter_GetNative_RETURN CompositeFilter_t*
42#define PyCompositeFilter_GetNative_PROTO (PyCompositeFilter*)
43
44#define PyCompositeFilter_New_NUM 2
45#define PyCompositeFilter_New_RETURN PyCompositeFilter*
46#define PyCompositeFilter_New_PROTO (CompositeFilter_t*)
47
48#define PyCompositeFilter_API_pointers 3
49
50#define PyCompositeFilter_CAPSULE_NAME "_compositefilter._C_API"
51
52
53#ifdef PYCOMPOSITEFILTER_MODULE
55extern PyTypeObject PyCompositeFilter_Type;
56
58#define PyCompositeFilter_Check(op) ((op)->ob_type == &PyCompositeFilter_Type)
59
62
65
66#else
68static void **PyCompositeFilter_API;
69
74#define PyCompositeFilter_GetNative \
75 (*(PyCompositeFilter_GetNative_RETURN (*)PyCompositeFilter_GetNative_PROTO) PyCompositeFilter_API[PyCompositeFilter_GetNative_NUM])
76
84#define PyCompositeFilter_New \
85 (*(PyCompositeFilter_New_RETURN (*)PyCompositeFilter_New_PROTO) PyCompositeFilter_API[PyCompositeFilter_New_NUM])
86
90#define PyCompositeFilter_Check(op) \
91 (Py_TYPE(op) == &PyCompositeFilter_Type)
92
93#define PyCompositeFilter_Type (*(PyTypeObject*)PyCompositeFilter_API[PyCompositeFilter_Type_NUM])
94
98#define import_compositefilter() \
99 PyCompositeFilter_API = (void **)PyCapsule_Import(PyCompositeFilter_CAPSULE_NAME, 1);
100
101#endif
102
103
104
105#endif /* PYCOMPOSITEFILTER_H */
A filter for matching composite arguments.
struct _CompositeFilter_t CompositeFilter_t
Defines a Geographical Area.
Definition compositefilter.h:37
#define PyCompositeFilter_New
Creates a new composite generator instance.
Definition pycompositefilter.h:84
#define PyCompositeFilter_GetNative_PROTO
arguments for GetNative
Definition pycompositefilter.h:42
#define PyCompositeFilter_GetNative_RETURN
return type for GetNative
Definition pycompositefilter.h:41
#define PyCompositeFilter_New_RETURN
return type for New
Definition pycompositefilter.h:45
#define PyCompositeFilter_GetNative
Returns a pointer to the internal composite, remember to release the reference when done with the obj...
Definition pycompositefilter.h:74
#define PyCompositeFilter_New_PROTO
arguments for New
Definition pycompositefilter.h:46
A composite argument structure.
Definition pycompositefilter.h:33
PyObject_HEAD CompositeFilter_t * filter
the composite filter
Definition pycompositefilter.h:35