RAVE
projectionregistry.h File Reference

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

#include "projection.h"
#include "rave_object.h"

Go to the source code of this file.

Typedefs

typedef struct _ProjectionRegistry_t ProjectionRegistry_t
 Defines the projection registry.
 

Functions

ProjectionRegistry_tProjectionRegistry_load (const char *filename)
 Loads a registry from an xml file.
 
int ProjectionRegistry_add (ProjectionRegistry_t *self, Projection_t *proj)
 Adds a projection to the registry.
 
int ProjectionRegistry_size (ProjectionRegistry_t *self)
 Returns the number of projections in this registry.
 
Projection_tProjectionRegistry_get (ProjectionRegistry_t *self, int index)
 Returns the projection at specified position.
 
Projection_tProjectionRegistry_getByName (ProjectionRegistry_t *self, const char *pcsid)
 Returns the projection with the specified pcs id.
 
void ProjectionRegistry_remove (ProjectionRegistry_t *self, int index)
 Removes the projection at the specified index.
 
void ProjectionRegistry_removeByName (ProjectionRegistry_t *self, const char *pcsid)
 Removes the projection with the specified pcs id.
 
int ProjectionRegistry_write (ProjectionRegistry_t *self, const char *filename)
 Writes the current registry to a xml file.
 

Variables

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

Detailed Description

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

This object supports RAVE_OBJECT_CLONE.

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

Typedef Documentation

◆ ProjectionRegistry_t

Defines the projection registry.

Function Documentation

◆ ProjectionRegistry_add()

int ProjectionRegistry_add ( ProjectionRegistry_t * self,
Projection_t * proj )

Adds a projection to the registry.

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

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

◆ ProjectionRegistry_get()

Projection_t * ProjectionRegistry_get ( ProjectionRegistry_t * self,
int index )

Returns the projection at specified position.

Parameters
[in]self- self
[in]index- the position of the projection
Returns
the found projection or NULL

◆ ProjectionRegistry_getByName()

Projection_t * ProjectionRegistry_getByName ( ProjectionRegistry_t * self,
const char * pcsid )

Returns the projection with the specified pcs id.

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

◆ ProjectionRegistry_load()

ProjectionRegistry_t * ProjectionRegistry_load ( const char * filename)

Loads a registry from an xml file.

Parameters
[in]filename- the name of the xml file
Returns
the projection registry

◆ ProjectionRegistry_remove()

void ProjectionRegistry_remove ( ProjectionRegistry_t * self,
int index )

Removes the projection at the specified index.

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

◆ ProjectionRegistry_removeByName()

void ProjectionRegistry_removeByName ( ProjectionRegistry_t * self,
const char * pcsid )

Removes the projection with the specified pcs id.

Parameters
[in]self- self
[in]pcsid- the projection id of the projection to remove

◆ ProjectionRegistry_size()

int ProjectionRegistry_size ( ProjectionRegistry_t * self)

Returns the number of projections in this registry.

Parameters
[in]self- self
Returns
the number of projections

◆ ProjectionRegistry_write()

int ProjectionRegistry_write ( ProjectionRegistry_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

◆ ProjectionRegistry_TYPE

RaveCoreObjectType ProjectionRegistry_TYPE
extern

Type definition to use when creating a rave object.