RAVE
pyacqva.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2024 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 PYACQVA_H
26#define PYACQVA_H
27#include "acqva.h"
28
32typedef struct {
33 PyObject_HEAD; /*Always has to be on top*/
35} PyAcqva;
36
37#define PyAcqva_Type_NUM 0
39#define PyAcqva_GetNative_NUM 1
40#define PyAcqva_GetNative_RETURN Acqva_t*
41#define PyAcqva_GetNative_PROTO (PyAcqva*)
43#define PyAcqva_New_NUM 2
44#define PyAcqva_New_RETURN PyAcqva*
45#define PyAcqva_New_PROTO (Acqva_t*)
47#define PyAcqva_API_pointers 3
49#define PyAcqva_CAPSULE_NAME "_pyacqva._C_API"
50
51
52#ifdef PYACQVA_MODULE
54extern PyTypeObject PyAcqva_Type;
55
57#define PyAcqva_Check(op) ((op)->ob_type == &PyAcqva_Type)
58
61
64
65#else
67static void **PyAcqva_API;
68
73#define PyAcqva_GetNative \
74 (*(PyAcqva_GetNative_RETURN (*)PyAcqva_GetNative_PROTO) PyAcqva_API[PyAcqva_GetNative_NUM])
75
83#define PyAcqva_New \
84 (*(PyAcqva_New_RETURN (*)PyAcqva_New_PROTO) PyAcqva_API[PyAcqva_New_NUM])
85
89#define PyAcqva_Check(op) \
90 (Py_TYPE(op) == &PyAcqva_Type)
91
92#define PyAcqva_Type (*(PyTypeObject*)PyAcqva_API[PyAcqva_Type_NUM])
93
97#define import_pyacqva() \
98 PyAcqva_API = (void **)PyCapsule_Import(PyAcqva_CAPSULE_NAME, 1);
99
100#endif
101
102
103
104#endif /* PyAcqva_H */
Provides functionality for creating composites according to the acqva method.
#define PyAcqva_GetNative_PROTO
arguments for GetNative
Definition pyacqva.h:41
#define PyAcqva_New_PROTO
arguments for New
Definition pyacqva.h:45
#define PyAcqva_GetNative_RETURN
return type for GetNative
Definition pyacqva.h:40
#define PyAcqva_New_RETURN
return type for New
Definition pyacqva.h:44
#define PyAcqva_New
Creates a new acqva instance.
Definition pyacqva.h:83
#define PyAcqva_GetNative
Returns a pointer to the internal composite, remember to release the reference when done with the obj...
Definition pyacqva.h:73
A composite generator.
Definition pyacqva.h:32
Acqva_t * acqva
the composite generator
Definition pyacqva.h:34
Represents the cartesian product.
Definition acqva.c:46