RAVE
composite_algorithm.h File Reference

Interface for defining your own compositing algorithm. More...

#include "rave_object.h"
#include "rave_types.h"
#include "raveobject_list.h"
#include "rave_field.h"

Go to the source code of this file.

Classes

struct  _CompositeAlgorithm_t
 The basic composite algorithm that can be cast into a subclassed processor. More...
 

Macros

#define COMPOSITE_ALGORITHM_HEAD
 The head part for a CompositeAlgorithm subclass.
 
#define CompositeAlgorithm_getName(self)
 Macro expansion for calling the name function.
 
#define CompositeAlgorithm_reset(self, x, y)
 Macro expansion for calling the process function.
 
#define CompositeAlgorithm_supportsProcess(self)
 Macro expansion if this algorithm supports process or not.
 
#define CompositeAlgorithm_process(self, obj, quantity, olon, olat, dist, otype, ovalue, navinfo)
 Macro expansion for calling the process function.
 
#define CompositeAlgorithm_initialize(self, objects)
 Macro expansion for initializing the algorithm.
 
#define CompositeAlgorithm_supportsFillQualityInformation(self, howtask)
 Macro expansion if this algorithm supports process or not.
 
#define CompositeAlgorithm_fillQualityInformation(self, obj, howtask, quantity, field, x, y, navinfo, gain, offset)
 Macro expansion if this algorithm supports process or not.
 

Typedefs

typedef const char *(* composite_algorithm_getName_fun) (struct _CompositeAlgorithm_t *self)
 
typedef 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.
 
typedef int(* composite_algorithm_supportsProcess_fun) (struct _CompositeAlgorithm_t *self)
 The supports process function that indicates if process is supported or not.
 
typedef 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.
 
typedef 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.
 
typedef 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.
 
typedef 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-.
 
typedef struct _CompositeAlgorithm_t CompositeAlgorithm_t
 The basic composite algorithm that can be cast into a subclassed processor.
 

Detailed Description

Interface for defining your own compositing algorithm.

This object type is used when you need to define your own way of determining if a composite value should be set or not. It is also quite strict when it comes to how to handle the method invocations. When the Composite_nearest or similar is started, the method CompositeAlgorithm_initialize will be called. Then, for each value calculated CompositeAlgorithm_process will be called.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2011-10-28

Macro Definition Documentation

◆ COMPOSITE_ALGORITHM_HEAD

#define COMPOSITE_ALGORITHM_HEAD
Value:
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
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
const char *(* composite_algorithm_getName_fun)(struct _CompositeAlgorithm_t *self)
Definition composite_algorithm.h:53

The head part for a CompositeAlgorithm subclass.

Should be placed directly under RAVE_OBJECT_HEAD like in CompositeAlgorithm_t.

◆ CompositeAlgorithm_fillQualityInformation

#define CompositeAlgorithm_fillQualityInformation ( self,
obj,
howtask,
quantity,
field,
x,
y,
navinfo,
gain,
offset )
Value:
((CompositeAlgorithm_t*)self)->fillQualityInformation((CompositeAlgorithm_t*)self,obj,howtask,quantity,field,x,y,navinfo,gain,offset)
The basic composite algorithm that can be cast into a subclassed processor.
Definition composite_algorithm.h:127

Macro expansion if this algorithm supports process or not.

◆ CompositeAlgorithm_getName

#define CompositeAlgorithm_getName ( self)
Value:
((CompositeAlgorithm_t*)self)->getName((CompositeAlgorithm_t*)self)

Macro expansion for calling the name function.

Parameters
[in]self- self
Returns
the unique name for this algorithm

◆ CompositeAlgorithm_initialize

#define CompositeAlgorithm_initialize ( self,
objects )
Value:
((CompositeAlgorithm_t*)self)->initialize((CompositeAlgorithm_t*)self, composite)

Macro expansion for initializing the algorithm.

Parameters
[in]self- self
[in]composite- the composite this algorithm will be working with
Returns
1 on success otherwise 0

◆ CompositeAlgorithm_process

#define CompositeAlgorithm_process ( self,
obj,
quantity,
olon,
olat,
dist,
otype,
ovalue,
navinfo )
Value:
((CompositeAlgorithm_t*)self)->process((CompositeAlgorithm_t*)self,obj,quantity,olon,olat,dist,otype,ovalue,navinfo)

Macro expansion for calling the process function.

Parameters
[in]self- self
[in]obj- the polar object (currently only scan and volume)
[in]quantity- the quantity we currently are working with
[in]olon- the longitude in radians
[in]olat- the latitude in radians
[in]dist- the distance from the radar origin to the given lon/lat.
[in,out]otype- the type of the data found
[in,out]ovalue- the value of the data found
[in]navinfo- the navigation info for the provided obj/olon/olat
Returns
1 if this value should be considered

◆ CompositeAlgorithm_reset

#define CompositeAlgorithm_reset ( self,
x,
y )
Value:
((CompositeAlgorithm_t*)self)->reset((CompositeAlgorithm_t*)self, x, y)

Macro expansion for calling the process function.

Parameters
[in]self- self
Returns
1 if this value should be considered

◆ CompositeAlgorithm_supportsFillQualityInformation

#define CompositeAlgorithm_supportsFillQualityInformation ( self,
howtask )
Value:
((CompositeAlgorithm_t*)self)->supportsFillQualityInformation((CompositeAlgorithm_t*)self,howtask)

Macro expansion if this algorithm supports process or not.

◆ CompositeAlgorithm_supportsProcess

#define CompositeAlgorithm_supportsProcess ( self)
Value:
((CompositeAlgorithm_t*)self)->supportsProcess((CompositeAlgorithm_t*)self)

Macro expansion if this algorithm supports process or not.

Typedef Documentation

◆ composite_algorithm_fillQualityInformation_fun

typedef 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-.

Parameters
[in]self- self
[in]obj- the object that was selected for setting the composite value
[in]howtask- the how/task value defining what quality attribute we are processing
[in]quantity- the quantity we are working with
[in]field- the quality field to be set
[in]x- the x position to be set in the field
[in]y- the y position to be set in the field
[in]navinfo- the navigation information that was used within the rave object
Returns
1 on success otherwise 0

◆ composite_algorithm_getName_fun

typedef const char *(* composite_algorithm_getName_fun) (struct _CompositeAlgorithm_t *self)
Returns
the unique name for this composite algorithm

◆ composite_algorithm_initialize_fun

typedef 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.

Note, this function will be called by the composite module and will override any previous calls.

Returns
1 on success otherwise 0

◆ composite_algorithm_processor_fun

typedef 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.

Parameters
[in]self- self
[in]obj- the polar object (currently only scan and volume)
[in]quantity- the quantity we currently are working with
[in]olon- the longitude in radians
[in]olat- the latitude in radians
[in]dist- the distance from the radar origin to the given lon/lat.
[in,out]otype- the type of the data found
[in,out]ovalue- the value of the data found
[in]navinfo- the navigation info for the provided obj/olon/olat
Returns
1 if this value should be used

◆ composite_algorithm_reset_fun

typedef 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.

This function might be useful if you want to set some start values.

◆ composite_algorithm_supportsFillQualityInformation_fun

typedef 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.

◆ composite_algorithm_supportsProcess_fun

typedef int(* composite_algorithm_supportsProcess_fun) (struct _CompositeAlgorithm_t *self)

The supports process function that indicates if process is supported or not.

◆ CompositeAlgorithm_t

The basic composite algorithm that can be cast into a subclassed processor.