RAVE
composite_algorithm.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2011 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------------------------------------------------------------------------*/
32#ifndef COMPOSITE_ALGORITHM_H
33#define COMPOSITE_ALGORITHM_H
34
35#include "rave_object.h"
36#include "rave_types.h"
37#include "raveobject_list.h"
38#include "rave_field.h"
39
43struct _Composite_t;
44
49
53typedef const char*(*composite_algorithm_getName_fun)(struct _CompositeAlgorithm_t* self);
54
59typedef void(*composite_algorithm_reset_fun)(struct _CompositeAlgorithm_t* self, int x, int y);
60
65
81 RaveCoreObject* obj, const char* quantity, double olon, double olat, double dist ,RaveValueType* otype, double* ovalue, \
82 PolarNavigationInfo* navinfo);
83
84
90typedef int(*composite_algorithm_initialize_fun)(struct _CompositeAlgorithm_t* self, struct _Composite_t* composite);
91
96
109typedef int(*composite_algorithm_fillQualityInformation_fun)(struct _CompositeAlgorithm_t* self, RaveCoreObject* obj, const char* howtask, const char* quantity, RaveField_t* field, long x, long y, PolarNavigationInfo* navinfo, double gain, double offset);
110
115#define COMPOSITE_ALGORITHM_HEAD \
116 composite_algorithm_getName_fun getName; \
117 composite_algorithm_supportsProcess_fun supportsProcess; \
118 composite_algorithm_processor_fun process; \
119 composite_algorithm_initialize_fun initialize; \
120 composite_algorithm_reset_fun reset; \
121 composite_algorithm_supportsFillQualityInformation_fun supportsFillQualityInformation; \
122 composite_algorithm_fillQualityInformation_fun fillQualityInformation;
123
131
137#define CompositeAlgorithm_getName(self) \
138 ((CompositeAlgorithm_t*)self)->getName((CompositeAlgorithm_t*)self)
139
145#define CompositeAlgorithm_reset(self, x, y) \
146 ((CompositeAlgorithm_t*)self)->reset((CompositeAlgorithm_t*)self, x, y)
147
151#define CompositeAlgorithm_supportsProcess(self) \
152 ((CompositeAlgorithm_t*)self)->supportsProcess((CompositeAlgorithm_t*)self)
153
167#define CompositeAlgorithm_process(self,obj,quantity,olon,olat,dist,otype,ovalue,navinfo) \
168 ((CompositeAlgorithm_t*)self)->process((CompositeAlgorithm_t*)self,obj,quantity,olon,olat,dist,otype,ovalue,navinfo)
169
176#define CompositeAlgorithm_initialize(self, objects) \
177 ((CompositeAlgorithm_t*)self)->initialize((CompositeAlgorithm_t*)self, composite)
178
182#define CompositeAlgorithm_supportsFillQualityInformation(self,howtask) \
183 ((CompositeAlgorithm_t*)self)->supportsFillQualityInformation((CompositeAlgorithm_t*)self,howtask)
184
188#define CompositeAlgorithm_fillQualityInformation(self,obj,howtask,quantity,field,x,y,navinfo,gain,offset) \
189 ((CompositeAlgorithm_t*)self)->fillQualityInformation((CompositeAlgorithm_t*)self,obj,howtask,quantity,field,x,y,navinfo,gain,offset)
190
191#endif /* COMPOSITE_ALGORITHM_H */
int(* composite_algorithm_fillQualityInformation_fun)(struct _CompositeAlgorithm_t *self, RaveCoreObject *obj, const char *howtask, const char *quantity, RaveField_t *field, long x, long y, PolarNavigationInfo *navinfo, double gain, double offset)
Function to be used when filling quality information into a rave field at pos x,y-.
Definition composite_algorithm.h:109
int(* composite_algorithm_supportsProcess_fun)(struct _CompositeAlgorithm_t *self)
The supports process function that indicates if process is supported or not.
Definition composite_algorithm.h:64
int(* composite_algorithm_initialize_fun)(struct _CompositeAlgorithm_t *self, struct _Composite_t *composite)
The initializing function so that we know what composite we are working with.
Definition composite_algorithm.h:90
struct _CompositeAlgorithm_t CompositeAlgorithm_t
The basic composite algorithm that can be cast into a subclassed processor.
int(* composite_algorithm_supportsFillQualityInformation_fun)(struct _CompositeAlgorithm_t *self, const char *howtask)
Function to be used when querying if this algorithm supports the quality field with how/task value.
Definition composite_algorithm.h:95
int(* composite_algorithm_processor_fun)(struct _CompositeAlgorithm_t *self, RaveCoreObject *obj, const char *quantity, double olon, double olat, double dist, RaveValueType *otype, double *ovalue, PolarNavigationInfo *navinfo)
The processor function definition.
Definition composite_algorithm.h:80
void(* composite_algorithm_reset_fun)(struct _CompositeAlgorithm_t *self, int x, int y)
The resetting mechanism that will be called for each new x/y position in the composite.
Definition composite_algorithm.h:59
#define COMPOSITE_ALGORITHM_HEAD
The head part for a CompositeAlgorithm subclass.
Definition composite_algorithm.h:115
Generic field that only provides a 2-dim data field and a number of dynamic attributes.
Generic implementation of an object that is used within rave.
#define RAVE_OBJECT_HEAD
Always should be at top of a struct that implements a RaveObject.
Definition rave_object.h:33
Type definitions for RAVE.
RaveValueType
Different value types.
Definition rave_types.h:72
Implementation of a rave object list that ensures that the objects contained within the list are rele...
Provides user with navigation information.
Definition rave_types.h:160
The basic composite algorithm that can be cast into a subclassed processor.
Definition composite_algorithm.h:127
Represents the cartesian product.
Definition composite.c:45
Represents the cartesian volume.
Definition rave_field.c:36
The basic raveobject that contains the header information for all rave objects.
Definition rave_object.h:42