RAVE
pyraveproperties.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2025 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 PYRAVEPROPERTIES_H
26#define PYRAVEPROPERTIES_H
27#include "rave_properties.h"
28
32typedef struct {
33 PyObject_HEAD /*Always has to be on top*/
36
37#define PyRaveProperties_Type_NUM 0
38
39#define PyRaveProperties_GetNative_NUM 1
40#define PyRaveProperties_GetNative_RETURN RaveProperties_t*
41#define PyRaveProperties_GetNative_PROTO (PyRaveProperties*)
42
43#define PyRaveProperties_New_NUM 2
44#define PyRaveProperties_New_RETURN PyRaveProperties*
45#define PyRaveProperties_New_PROTO (RaveProperties_t*)
46
47//#define PyRaveProperties_Load_NUM 3 /**< index for Load */
48//#define PyRaveProperties_Load_RETURN PyRaveProperties* /**< return type for Load */
49//#define PyRaveProperties_Load_PROTO (const char* filename, PyProjectionRegistry* pyprojregistry) /**< argument prototype for Open */
50
51#define PyRaveProperties_API_pointers 3
52
53#define PyRaveProperties_CAPSULE_NAME "_raveproperties._C_API"
54
55#ifdef PYRAVEPROPERTIES_MODULE
57extern PyTypeObject PyRaveProperties_Type;
58
60#define PyRaveProperties_Check(op) ((op)->ob_type == &PyRaveProperties_Type)
61
64
67
71#else
73static void **PyRaveProperties_API;
74
79#define PyRaveProperties_GetNative \
80 (*(PyRaveProperties_GetNative_RETURN (*)PyRaveProperties_GetNative_PROTO) PyRaveProperties_API[PyRaveProperties_GetNative_NUM])
81
89#define PyRaveProperties_New \
90 (*(PyRaveProperties_New_RETURN (*)PyRaveProperties_New_PROTO) PyRaveProperties_API[PyRaveProperties_New_NUM])
91
100
104#define PyRaveProperties_Check(op) \
105 (Py_TYPE(op) == &PyRaveProperties_Type)
106
107#define PyRaveProperties_Type (*(PyTypeObject*)PyRaveProperties_API[PyRaveProperties_Type_NUM])
108
112#define import_raveproperties() \
113 PyRaveProperties_API = (void **)PyCapsule_Import(PyRaveProperties_CAPSULE_NAME, 1);
114
115#endif
116
117#endif /* PYRAVEPROPERTIES_H */
#define PyRaveProperties_GetNative_PROTO
arguments for GetNative
Definition pyraveproperties.h:41
#define PyRaveProperties_New_RETURN
return type for New
Definition pyraveproperties.h:44
#define PyRaveProperties_GetNative_RETURN
return type for GetNative
Definition pyraveproperties.h:40
#define PyRaveProperties_GetNative
Returns a pointer to the internal area, remember to release the reference when done with the object.
Definition pyraveproperties.h:79
#define PyRaveProperties_New_PROTO
arguments for New
Definition pyraveproperties.h:45
#define PyRaveProperties_New
Creates a area registry instance.
Definition pyraveproperties.h:89
Property handling This object supports RAVE_OBJECT_CLONE.
struct _RaveProperties_t RaveProperties_t
Defines the area registry.
Definition rave_properties.h:35
A cartesian product.
Definition pyraveproperties.h:32
PyObject_HEAD RaveProperties_t * properties
the instance
Definition pyraveproperties.h:34