RAVE
pylazynodelistreader.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2020- 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 PYLAZYNODELISTIO_H
26#define PYLAZYNODELISTIO_H
27#include <lazy_nodelist_reader.h>
28
32typedef struct {
33 PyObject_HEAD /* Always has to be on top */
36
37#define PyLazyNodeListReader_Type_NUM 0
39#define PyLazyNodeListReader_GetNative_NUM 1
40#define PyLazyNodeListReader_GetNative_RETURN LazyNodeListReader_t*
41#define PyLazyNodeListReader_GetNative_PROTO (PyLazyNodeListReader*)
43#define PyLazyNodeListReader_New_NUM 2
44#define PyLazyNodeListReader_New_RETURN PyLazyNodeListReader*
45#define PyLazyNodeListReader_New_PROTO (LazyNodeListReader_t*)
47#define PyLazyNodeListReader_Read_NUM 3
48#define PyLazyNodeListReader_Read_RETURN PyLazyNodeListReader*
49#define PyLazyNodeListReader_Read_PROTO (const char* filename)
52#define PyLazyNodeListReader_API_pointers 4
54#define PyLazyNodeListReader_CAPSULE_NAME "_lazynodelistreader._C_API"
55
56#ifdef PYLAZYNODELISTREADER_MODULE
58extern PyTypeObject PyLazyNodeListReader_Type;
59
61#define PyLazyNodeListReader_Check(op) ((op)->ob_type == &PyLazyNodeListReader_Type)
62
65
68
71
72#else
74static void **PyLazyNodeListReader_API;
75
80#define PyLazyNodeListReader_GetNative \
81 (*(PyLazyNodeListReader_GetNative_RETURN (*)PyLazyNodeListReader_GetNative_PROTO) PyLazyNodeListReader_API[PyLazyNodeListReader_GetNative_NUM])
82
90#define PyLazyNodeListReader_New \
91 (*(PyLazyNodeListReader_New_RETURN (*)PyLazyNodeListReader_New_PROTO) PyLazyNodeListReader_API[PyLazyNodeListReader_New_NUM])
92
98#define PyLazyNodeListReader_Read \
99 (*(PyLazyNodeListReader_Read_RETURN (*)PyLazyNodeListReader_Read_PROTO) PyLazyNodeListReader_API[PyLazyNodeListReader_Read_NUM])
100
104#define PyLazyNodeListReader_Check(op) \
105 (Py_TYPE(op) == &PyLazyNodeListReader_Type)
106
107#define PyLazyNodeListReader_Type (*(PyTypeObject*)PyLazyNodeListReader_API[PyLazyNodeListReader_Type_NUM])
108
112#define import_pylazynodelistio() \
113 PyLazyNodeListReader_API = (void **)PyCapsule_Import(PyLazyNodeListReader_CAPSULE_NAME, 1);
114
115#endif
116
117#endif /* PYLAZYNODELISTIO_H */
#define PyLazyNodeListReader_GetNative_RETURN
return type for GetNative
Definition pylazynodelistreader.h:40
#define PyLazyNodeListReader_New_RETURN
return type for New
Definition pylazynodelistreader.h:44
#define PyLazyNodeListReader_Read_PROTO
argument prototype for Read
Definition pylazynodelistreader.h:49
#define PyLazyNodeListReader_New_PROTO
argument prototype for New
Definition pylazynodelistreader.h:45
#define PyLazyNodeListReader_Read_RETURN
return type for Read
Definition pylazynodelistreader.h:48
#define PyLazyNodeListReader_Read
Read a file into a lazynodelistio instance.
Definition pylazynodelistreader.h:98
#define PyLazyNodeListReader_New
Creates a new lazy nodelist io instance.
Definition pylazynodelistreader.h:90
#define PyLazyNodeListReader_GetNative
Returns a pointer to the internal lazy nodelist io, remember to release the reference when done with ...
Definition pylazynodelistreader.h:80
#define PyLazyNodeListReader_GetNative_PROTO
argument prototype for GetNative
Definition pylazynodelistreader.h:41
The LazyNodeListReader.
Definition pylazynodelistreader.h:32
PyObject_HEAD LazyNodeListReader_t * reader
the lazy nodelist instance instance
Definition pylazynodelistreader.h:34
Represents the lazy nodelist loader.
Definition lazy_nodelist_reader.c:21