RAVE
pyprojectionregistry.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 PYPROJECTIONREGISTRY_H
26#define PYPROJECTIONREGISTRY_H
27#include "projectionregistry.h"
28
32typedef struct {
33 PyObject_HEAD /*Always has to be on top*/
36
37#define PyProjectionRegistry_Type_NUM 0
39#define PyProjectionRegistry_GetNative_NUM 1
40#define PyProjectionRegistry_GetNative_RETURN ProjectionRegistry_t*
41#define PyProjectionRegistry_GetNative_PROTO (PyProjectionRegistry*)
43#define PyProjectionRegistry_New_NUM 2
44#define PyProjectionRegistry_New_RETURN PyProjectionRegistry*
45#define PyProjectionRegistry_New_PROTO (ProjectionRegistry_t*)
47#define PyProjectionRegistry_Load_NUM 3
48#define PyProjectionRegistry_Load_RETURN PyProjectionRegistry*
49#define PyProjectionRegistry_Load_PROTO (const char* filename)
51#define PyProjectionRegistry_API_pointers 4
53#define PyProjectionRegistry_CAPSULE_NAME "_projectionregistry._C_API"
54
55#ifdef PYPROJECTIONREGISTRY_MODULE
57extern PyTypeObject PyProjectionRegistry_Type;
58
60#define PyProjectionRegistry_Check(op) ((op)->ob_type == &PyProjectionRegistry_Type)
61
64
67
70
71#else
73static void **PyProjectionRegistry_API;
74
79#define PyProjectionRegistry_GetNative \
80 (*(PyProjectionRegistry_GetNative_RETURN (*)PyProjectionRegistry_GetNative_PROTO) PyProjectionRegistry_API[PyProjectionRegistry_GetNative_NUM])
81
89#define PyProjectionRegistry_New \
90 (*(PyProjectionRegistry_New_RETURN (*)PyProjectionRegistry_New_PROTO) PyProjectionRegistry_API[PyProjectionRegistry_New_NUM])
91
97#define PyProjectionRegistry_Load \
98 (*(PyProjectionRegistry_Load_RETURN (*)PyProjectionRegistry_Load_PROTO) PyProjectionRegistry_API[PyProjectionRegistry_Load_NUM])
99
103#define PyProjectionRegistry_Check(op) \
104 (Py_TYPE(op) == &PyProjectionRegistry_Type)
105
106#define PyProjectionRegistry_Type (*(PyTypeObject*)PyProjectionRegistry_API[PyProjectionRegistry_Type_NUM])
107
111#define import_pyprojectionregistry() \
112 PyProjectionRegistry_API = (void **)PyCapsule_Import(PyProjectionRegistry_CAPSULE_NAME, 1);
113
114#endif
115
116#endif /* PYPROJECTIONREGISTRY_H */
Provides support for reading and writing projections to and from an xml-file.
#define PyProjectionRegistry_Load
Loads a projection registry instance.
Definition pyprojectionregistry.h:97
#define PyProjectionRegistry_New
Creates a projection registry instance.
Definition pyprojectionregistry.h:89
#define PyProjectionRegistry_New_RETURN
return type for New
Definition pyprojectionregistry.h:44
#define PyProjectionRegistry_New_PROTO
arguments for New
Definition pyprojectionregistry.h:45
#define PyProjectionRegistry_Load_RETURN
return type for Load
Definition pyprojectionregistry.h:48
#define PyProjectionRegistry_Load_PROTO
argument prototype for Open
Definition pyprojectionregistry.h:49
#define PyProjectionRegistry_GetNative_RETURN
return type for GetNative
Definition pyprojectionregistry.h:40
#define PyProjectionRegistry_GetNative_PROTO
arguments for GetNative
Definition pyprojectionregistry.h:41
#define PyProjectionRegistry_GetNative
Returns a pointer to the internal registry, remember to release the reference when done with the obje...
Definition pyprojectionregistry.h:79
A projection registry.
Definition pyprojectionregistry.h:32
PyObject_HEAD ProjectionRegistry_t * registry
the projection registry
Definition pyprojectionregistry.h:34
Represents the registry.
Definition projectionregistry.c:36