RAVE
pyarearegistry.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2010 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 PYAREAREGISTRY_H
26#define PYAREAREGISTRY_H
27#include "arearegistry.h"
29
33typedef struct {
34 PyObject_HEAD /*Always has to be on top*/
37
38#define PyAreaRegistry_Type_NUM 0
40#define PyAreaRegistry_GetNative_NUM 1
41#define PyAreaRegistry_GetNative_RETURN AreaRegistry_t*
42#define PyAreaRegistry_GetNative_PROTO (PyAreaRegistry*)
44#define PyAreaRegistry_New_NUM 2
45#define PyAreaRegistry_New_RETURN PyAreaRegistry*
46#define PyAreaRegistry_New_PROTO (AreaRegistry_t*)
48#define PyAreaRegistry_Load_NUM 3
49#define PyAreaRegistry_Load_RETURN PyAreaRegistry*
50#define PyAreaRegistry_Load_PROTO (const char* filename, PyProjectionRegistry* pyprojregistry)
52#define PyAreaRegistry_API_pointers 4
54#define PyAreaRegistry_CAPSULE_NAME "_area._C_API"
55
56#ifdef PYAREAREGISTRY_MODULE
58extern PyTypeObject PyAreaRegistry_Type;
59
61#define PyAreaRegistry_Check(op) ((op)->ob_type == &PyAreaRegistry_Type)
62
65
68
71
72#else
74static void **PyAreaRegistry_API;
75
80#define PyAreaRegistry_GetNative \
81 (*(PyAreaRegistry_GetNative_RETURN (*)PyAreaRegistry_GetNative_PROTO) PyAreaRegistry_API[PyAreaRegistry_GetNative_NUM])
82
90#define PyAreaRegistry_New \
91 (*(PyAreaRegistry_New_RETURN (*)PyAreaRegistry_New_PROTO) PyAreaRegistry_API[PyAreaRegistry_New_NUM])
92
99#define PyAreaRegistry_Load \
100 (*(PyAreaRegistry_Load_RETURN (*)PyAreaRegistry_Load_PROTO) PyAreaRegistry_API[PyAreaRegistry_Load_NUM])
101
105#define PyAreaRegistry_Check(op) \
106 (Py_TYPE(op) == &PyAreaRegistry_Type)
107
108#define PyAreaRegistry_Type (*(PyTypeObject*)PyAreaRegistry_API[PyAreaRegistry_Type_NUM])
109
113#define import_pyarearegistry() \
114 PyAreaRegistry_API = (void **)PyCapsule_Import(PyAreaRegistry_CAPSULE_NAME, 1);
115
116#endif
117
118#endif /* PYAREAREGISTRY_H */
Provides support for reading and writing areas to and from an xml-file.
#define PyAreaRegistry_GetNative
Returns a pointer to the internal area, remember to release the reference when done with the object.
Definition pyarearegistry.h:80
#define PyAreaRegistry_New_PROTO
arguments for New
Definition pyarearegistry.h:46
#define PyAreaRegistry_Load_RETURN
return type for Load
Definition pyarearegistry.h:49
#define PyAreaRegistry_Load_PROTO
argument prototype for Open
Definition pyarearegistry.h:50
#define PyAreaRegistry_GetNative_RETURN
return type for GetNative
Definition pyarearegistry.h:41
#define PyAreaRegistry_GetNative_PROTO
arguments for GetNative
Definition pyarearegistry.h:42
#define PyAreaRegistry_Load
Loads a area registry instance.
Definition pyarearegistry.h:99
#define PyAreaRegistry_New
Creates a area registry instance.
Definition pyarearegistry.h:90
#define PyAreaRegistry_New_RETURN
return type for New
Definition pyarearegistry.h:45
Python version of the Projection registry API.
A cartesian product.
Definition pyarearegistry.h:33
PyObject_HEAD AreaRegistry_t * registry
the area registry
Definition pyarearegistry.h:35
Represents the registry.
Definition arearegistry.c:38