RAVE
arearegistry.h File Reference

Provides support for reading and writing areas to and from an xml-file. More...

#include "area.h"
#include "rave_object.h"
#include "projectionregistry.h"

Go to the source code of this file.

Typedefs

typedef struct _AreaRegistry_t AreaRegistry_t
 Defines the area registry.
 

Functions

AreaRegistry_tAreaRegistry_load (const char *filename, ProjectionRegistry_t *pRegistry)
 Simplified loading function, takes filename and a projection registry.
 
int AreaRegistry_add (AreaRegistry_t *self, Area_t *area)
 Adds an area to the registry.
 
int AreaRegistry_size (AreaRegistry_t *self)
 Returns the number of registered areas.
 
Area_tAreaRegistry_get (AreaRegistry_t *self, int index)
 Returns the area at specified index.
 
Area_tAreaRegistry_getByName (AreaRegistry_t *self, const char *id)
 Returns the area with the specified id.
 
void AreaRegistry_remove (AreaRegistry_t *self, int index)
 Removes the area at the specified index.
 
void AreaRegistry_removeByName (AreaRegistry_t *self, const char *id)
 Removes the area with the specified id.
 
void AreaRegistry_setProjectionRegistry (AreaRegistry_t *self, ProjectionRegistry_t *registry)
 Sets a projection registry to be able to fetch projections.
 
ProjectionRegistry_tAreaRegistry_getProjectionRegistry (AreaRegistry_t *self)
 Sets a projection registry to be able to fetch projections.
 
int AreaRegistry_write (AreaRegistry_t *self, const char *filename)
 Writes the current registry to a xml file.
 

Variables

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

Detailed Description

Provides support for reading and writing areas to and from an xml-file.

This object supports RAVE_OBJECT_CLONE.

Author
Anders Henja (Swedish Meteorological and Hydrological Institute, SMHI)
Date
2010-12-08

Typedef Documentation

◆ AreaRegistry_t

Defines the area registry.

Function Documentation

◆ AreaRegistry_add()

int AreaRegistry_add ( AreaRegistry_t * self,
Area_t * area )

Adds an area to the registry.

There will be no check if the area already exists so it is up to the user to ensure that no duplicates are added.

Parameters
[in]self- self
[in]area- the area to add
Returns
1 on success otherwise 0

◆ AreaRegistry_get()

Area_t * AreaRegistry_get ( AreaRegistry_t * self,
int index )

Returns the area at specified index.

Parameters
[in]self- self
[in]index- the index
Returns
the area or NULL if no such area

◆ AreaRegistry_getByName()

Area_t * AreaRegistry_getByName ( AreaRegistry_t * self,
const char * id )

Returns the area with the specified id.

Parameters
[in]self- self
[in]id- the area id
Returns
the found area or NULL

◆ AreaRegistry_getProjectionRegistry()

ProjectionRegistry_t * AreaRegistry_getProjectionRegistry ( AreaRegistry_t * self)

Sets a projection registry to be able to fetch projections.

Parameters
[in]self- self
Returns
the projection registry

◆ AreaRegistry_load()

AreaRegistry_t * AreaRegistry_load ( const char * filename,
ProjectionRegistry_t * pRegistry )

Simplified loading function, takes filename and a projection registry.

Parameters
[in]filename- the area file name
[in]pRegistry- the projection registry
Returns
an area registry

◆ AreaRegistry_remove()

void AreaRegistry_remove ( AreaRegistry_t * self,
int index )

Removes the area at the specified index.

Parameters
[in]self- self
[in]index- the index of the area to remove

◆ AreaRegistry_removeByName()

void AreaRegistry_removeByName ( AreaRegistry_t * self,
const char * id )

Removes the area with the specified id.

Parameters
[in]self- self
[in]id- the id of the area to remove

◆ AreaRegistry_setProjectionRegistry()

void AreaRegistry_setProjectionRegistry ( AreaRegistry_t * self,
ProjectionRegistry_t * registry )

Sets a projection registry to be able to fetch projections.

Parameters
[in]self- self
[in]registry- the projection registry

◆ AreaRegistry_size()

int AreaRegistry_size ( AreaRegistry_t * self)

Returns the number of registered areas.

Parameters
[in]self- self
Returns
the number of registered areas

◆ AreaRegistry_write()

int AreaRegistry_write ( AreaRegistry_t * self,
const char * filename )

Writes the current registry to a xml file.

Parameters
[in]self- self
[in]filename- the name of the file
Returns
1 on success or 0 on failure

Variable Documentation

◆ AreaRegistry_TYPE

RaveCoreObjectType AreaRegistry_TYPE
extern

Type definition to use when creating a rave object.