RAVE
pycompositealgorithm.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 PYCOMPOSITEALGORITHM_H
26#define PYCOMPOSITEALGORITHM_H
27#include "Python.h"
28#include "composite_algorithm.h"
29
33typedef struct {
34 PyObject_HEAD
37
38#define PyCompositeAlgorithm_Type_NUM 0
40#define PyCompositeAlgorithm_GetNative_NUM 1
41#define PyCompositeAlgorithm_GetNative_RETURN CompositeAlgorithm_t*
42#define PyCompositeAlgorithm_GetNative_PROTO (PyCompositeAlgorithm*)
44#define PyCompositeAlgorithm_New_NUM 2
45#define PyCompositeAlgorithm_New_RETURN PyCompositeAlgorithm*
46#define PyCompositeAlgorithm_New_PROTO (CompositeAlgorithm_t*)
48#define PyCompositeAlgorithm_API_pointers 3
50#define PyCompositeAlgorithm_CAPSULE_NAME "_compositealgorithm._C_API"
51
52#ifdef PYCOMPOSITEALGORITHM_MODULE
54extern PyTypeObject PyCompositeAlgorithm_Type;
55
57#define PyCompositeAlgorithm_Check(op) ((op)->ob_type == &PyCompositeAlgorithm_Type)
58
61
64
65#else
67static void **PyCompositeAlgorithm_API;
68
73#define PyCompositeAlgorithm_GetNative \
74 (*(PyCompositeAlgorithm_GetNative_RETURN (*)PyCompositeAlgorithm_GetNative_PROTO) PyCompositeAlgorithm_API[PyCompositeAlgorithm_GetNative_NUM])
75
83#define PyCompositeAlgorithm_New \
84 (*(PyCompositeAlgorithm_New_RETURN (*)PyCompositeAlgorithm_New_PROTO) PyCompositeAlgorithm_API[PyCompositeAlgorithm_New_NUM])
85
86
90#define PyCompositeAlgorithm_Check(op) \
91 (Py_TYPE(op) == &PyCompositeAlgorithm_Type)
92
93#define PyCompositeAlgorithm_Type (*(PyTypeObject*)PyCompositeAlgorithm_API[PyCompositeAlgorithm_Type_NUM])
94
98#define import_compositealgorithm() \
99 PyCompositeAlgorithm_API = (void **)PyCapsule_Import(PyCompositeAlgorithm_CAPSULE_NAME, 1);
100
101#endif
102
103#endif /* PYPOOCOMPOSITEALGORITHM_H */
Interface for defining your own compositing algorithm.
#define PyCompositeAlgorithm_New_PROTO
arguments for New
Definition pycompositealgorithm.h:46
#define PyCompositeAlgorithm_GetNative
Returns a pointer to the internal composite algorithm, remember to release the reference when done wi...
Definition pycompositealgorithm.h:73
#define PyCompositeAlgorithm_GetNative_RETURN
return type for GetNative
Definition pycompositealgorithm.h:41
#define PyCompositeAlgorithm_GetNative_PROTO
arguments for GetNative
Definition pycompositealgorithm.h:42
#define PyCompositeAlgorithm_New
Creates a composite algorithm instance.
Definition pycompositealgorithm.h:83
#define PyCompositeAlgorithm_New_RETURN
return type for New
Definition pycompositealgorithm.h:45
The poo composite algorithm instance.
Definition pycompositealgorithm.h:33
PyObject_HEAD CompositeAlgorithm_t * algorithm
the composite algorithm
Definition pycompositealgorithm.h:35
The basic composite algorithm that can be cast into a subclassed processor.
Definition composite_algorithm.h:127