RAVE
compositegenerator.c File Reference

Provides functionality for creating composites. More...

#include "compositegenerator.h"
#include "cartesian.h"
#include "compositearguments.h"
#include "compositefactorymanager.h"
#include "compositefilter.h"
#include "compositegeneratorfactory.h"
#include "polarvolume.h"
#include "rave_attribute.h"
#include "rave_list.h"
#include "rave_object.h"
#include "raveobject_hashtable.h"
#include "raveobject_list.h"
#include "rave_types.h"
#include "rave_debug.h"
#include "rave_alloc.h"
#include "rave_utilities.h"
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include "rave_simplexml.h"
#include "legacycompositegeneratorfactory.h"
#include "acqvacompositegeneratorfactory.h"

Classes

struct  _CompositeGenerator_t
 Represents the cartesian product. More...
 
struct  CompositeFactoryEntry_t
 The object entry that is stored inside the arguments. More...
 

Typedefs

typedef struct CompositeFactoryEntry_t CompositeFactoryEntry_t
 The object entry that is stored inside the arguments.
 

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 CompositeFactoryEntry_TYPE
 
RaveCoreObjectType CompositeGenerator_TYPE
 Type definition to use when creating a rave object.
 

Detailed Description

Provides functionality for creating composites.

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

Typedef Documentation

◆ CompositeFactoryEntry_t

typedef struct CompositeFactoryEntry_t CompositeFactoryEntry_t

The object entry that is stored inside the arguments.

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

◆ CompositeFactoryEntry_TYPE

RaveCoreObjectType CompositeFactoryEntry_TYPE
Initial value:
= {
"CompositeFactoryEntry",
CompositeFactoryEntry_constructor,
CompositeFactoryEntry_destructor,
CompositeFactoryEntry_copyconstructor
}
The object entry that is stored inside the arguments.
Definition compositegenerator.c:64

◆ CompositeGenerator_TYPE

RaveCoreObjectType CompositeGenerator_TYPE
Initial value:
= {
"CompositeGenerator",
CompositeGenerator_constructor,
CompositeGenerator_destructor,
CompositeGenerator_copyconstructor
}
struct _CompositeGenerator_t CompositeGenerator_t
Defines a Composite generator.
Definition compositegenerator.h:43

Type definition to use when creating a rave object.