RAVE
compositegenerator.h File Reference

Generator for generating composites using various approaches. More...

#include "cartesian.h"
#include "compositegeneratorfactory.h"
#include "compositefactorymanager.h"
#include "compositearguments.h"
#include "rave_object.h"
#include "rave_types.h"
#include "raveobject_hashtable.h"
#include "rave_properties.h"
#include "limits.h"

Go to the source code of this file.

Typedefs

typedef struct _CompositeGenerator_t CompositeGenerator_t
 Defines a Composite generator.
 

Functions

CompositeGenerator_tCompositeGenerator_create (CompositeFactoryManager_t *manager, const char *filename)
 Creates a composite generator containing both factory manager and intialized with a factory filter.
 
int CompositeGenerator_setProperties (CompositeGenerator_t *generator, RaveProperties_t *properties)
 Sets properties to the generator.
 
RaveProperties_tCompositeGenerator_getProperties (CompositeGenerator_t *generator)
 
int CompositeGenerator_register (CompositeGenerator_t *generator, const char *id, CompositeGeneratorFactory_t *factory, RaveObjectList_t *filters)
 Registers a generator factory in the the generator.
 
RaveList_tCompositeGenerator_getFactoryIDs (CompositeGenerator_t *generator)
 Returns a list of registered factory ids.
 
void CompositeGenerator_unregister (CompositeGenerator_t *generator, const char *id)
 Removes the factory with specified id.
 
CompositeGeneratorFactory_tCompositeGenerator_identify (CompositeGenerator_t *generator, CompositeArguments_t *arguments)
 Will identify the candidate factory from the provided arguments.
 
CompositeGeneratorFactory_tCompositeGenerator_createFactory (CompositeGenerator_t *generator, CompositeArguments_t *arguments)
 Will identify the factory, create a new instance of this factory and set the properties before returning it.
 
Cartesian_tCompositeGenerator_generate (CompositeGenerator_t *generator, CompositeArguments_t *arguments)
 Generates a composite according to the configured parameters in the composite structure.
 

Variables

RaveCoreObjectType CompositeGenerator_TYPE
 Type definition to use when creating a rave object.
 

Detailed Description

Generator for generating composites using various approaches.

You are able to register your own composite methods so that you get a standard methodology when creating them.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2024-10-09

Typedef Documentation

◆ CompositeGenerator_t

Defines a Composite generator.

Function Documentation

◆ CompositeGenerator_create()

CompositeGenerator_t * CompositeGenerator_create ( CompositeFactoryManager_t * manager,
const char * filename )

Creates a composite generator containing both factory manager and intialized with a factory filter.

Parameters
[in]manager- the factory manager. May be NULL and then the default factory manager will be created
[in]filename- the filename to load. May be NULL and then no filters will be set
Returns
the generator
an initialized composite generator

◆ CompositeGenerator_createFactory()

CompositeGeneratorFactory_t * CompositeGenerator_createFactory ( CompositeGenerator_t * generator,
CompositeArguments_t * arguments )

Will identify the factory, create a new instance of this factory and set the properties before returning it.

Parameters
[in]generator- self
[in]arguments- the arguments
Returns
the identified factory or NULL if nothing found

◆ CompositeGenerator_generate()

Cartesian_t * CompositeGenerator_generate ( CompositeGenerator_t * generator,
CompositeArguments_t * arguments )

Generates a composite according to the configured parameters in the composite structure.

Parameters
[in]generator- self
[in]arguments- the arguments
Returns
the generated composite.

◆ CompositeGenerator_getFactoryIDs()

RaveList_t * CompositeGenerator_getFactoryIDs ( CompositeGenerator_t * generator)

Returns a list of registered factory ids.

NOTE: Remember to use RaveList_freeAndDestroy to release all memory in the returned RaveList_t.

Parameters
[in]generator- self
Returns
a list of registered factory ids

◆ CompositeGenerator_getProperties()

RaveProperties_t * CompositeGenerator_getProperties ( CompositeGenerator_t * generator)
Returns
the properties (can be NULL)

◆ CompositeGenerator_identify()

CompositeGeneratorFactory_t * CompositeGenerator_identify ( CompositeGenerator_t * generator,
CompositeArguments_t * arguments )

Will identify the candidate factory from the provided arguments.

Parameters
[in]generator- self
[in]arguments- the arguments
Returns
the identified factory or NULL if nothing found

◆ CompositeGenerator_register()

int CompositeGenerator_register ( CompositeGenerator_t * generator,
const char * id,
CompositeGeneratorFactory_t * factory,
RaveObjectList_t * filters )

Registers a generator factory in the the generator.

Parameters
[in]generator- self
[in]id- the id of the factory
[in]facgtory- the actual factory
[in]filters- the filters matching this factory
Returns
1 if factory added successfully, otherwise 0

◆ CompositeGenerator_setProperties()

int CompositeGenerator_setProperties ( CompositeGenerator_t * generator,
RaveProperties_t * properties )

Sets properties to the generator.

NOTE! These properties will be passed to the used factory in the generate function using the initialize method.

Parameters
[in]generator- self
[in]properties- the properties
Returns
1 on success otherwise 0

◆ CompositeGenerator_unregister()

void CompositeGenerator_unregister ( CompositeGenerator_t * generator,
const char * id )

Removes the factory with specified id.

If id doesn't exist nothing will be done,

Parameters
[in]generator- self
[in]id- the id of the factory to remove

Variable Documentation

◆ CompositeGenerator_TYPE

RaveCoreObjectType CompositeGenerator_TYPE
extern

Type definition to use when creating a rave object.