RAVE
rave_iocache.h File Reference

Functions for managing io cache files like static files. More...

#include "rave_object.h"
#include "rave_field.h"

Go to the source code of this file.

Typedefs

typedef struct _RaveIOCache_t RaveIOCache_t
 Defines a Rave IO Cache instance.
 

Functions

RaveField_tRaveIOCache_loadField (RaveIOCache_t *iocache, const char *filename, const char *fieldname)
 Opens a supported HDF5 file and loads it into the RaveIOCache instance.
 
int RaveIOCache_saveField (RaveIOCache_t *iocache, RaveField_t *obj, const char *filename)
 Saves a rave object as specified.
 
void RaveIOCache_setCompressionLevel (RaveIOCache_t *iocache, int lvl)
 Sets the compression level.
 
int RaveIOCache_getCompressionLevel (RaveIOCache_t *iocache)
 Returns the compression level.
 
void RaveIOCache_setUserBlock (RaveIOCache_t *iocache, unsigned long long userblock)
 Sets the user block.
 
unsigned long long RaveIOCache_getUserBlock (RaveIOCache_t *iocache)
 Returns the user block.
 
void RaveIOCache_setSizes (RaveIOCache_t *iocache, size_t sz, size_t addr)
 Sets the sizes.
 
void RaveIOCache_getSizes (RaveIOCache_t *iocache, size_t *sz, size_t *addr)
 Returns the sizes.
 
void RaveIOCache_setSymk (RaveIOCache_t *iocache, int ik, int lk)
 Sets the symk.
 
void RaveIOCache_getSymk (RaveIOCache_t *iocache, int *ik, int *lk)
 Returns the symk.
 
void RaveIOCache_setIStoreK (RaveIOCache_t *iocache, long k)
 Sets the istore_k value.
 
long RaveIOCache_getIStoreK (RaveIOCache_t *iocache)
 Returns the istore_k value.
 
void RaveIOCache_setMetaBlockSize (RaveIOCache_t *iocache, long sz)
 Sets the meta block size.
 
long RaveIOCache_getMetaBlockSize (RaveIOCache_t *iocache)
 Returns the meta block size.
 
const char * RaveIOCache_getErrorMessage (RaveIOCache_t *iocache)
 If an error occurs during writing, you might get an indication for why by checking the error message.
 

Variables

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

Detailed Description

Functions for managing io cache files like static files.

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

Typedef Documentation

◆ RaveIOCache_t

typedef struct _RaveIOCache_t RaveIOCache_t

Defines a Rave IO Cache instance.

Function Documentation

◆ RaveIOCache_getCompressionLevel()

int RaveIOCache_getCompressionLevel ( RaveIOCache_t * iocache)

Returns the compression level.

Parameters
[in]iocache-self
Returns
the compression level

◆ RaveIOCache_getErrorMessage()

const char * RaveIOCache_getErrorMessage ( RaveIOCache_t * iocache)

If an error occurs during writing, you might get an indication for why by checking the error message.

Parameters
[in]iocache- rave io
Returns
the error message (will be an empty string if nothing to report).

◆ RaveIOCache_getIStoreK()

long RaveIOCache_getIStoreK ( RaveIOCache_t * iocache)

Returns the istore_k value.

Parameters
[in]iocache- self
Returns
the istore_k value

◆ RaveIOCache_getMetaBlockSize()

long RaveIOCache_getMetaBlockSize ( RaveIOCache_t * iocache)

Returns the meta block size.

Parameters
[in]iocache- self
Returns
the meta block size

◆ RaveIOCache_getSizes()

void RaveIOCache_getSizes ( RaveIOCache_t * iocache,
size_t * sz,
size_t * addr )

Returns the sizes.

Parameters
[in]iocache- self
[in]sz- same as sizes.sizeof_size
[in]addr- same as sizes.sizeof_addr

◆ RaveIOCache_getSymk()

void RaveIOCache_getSymk ( RaveIOCache_t * iocache,
int * ik,
int * lk )

Returns the symk.

Parameters
[in]iocache- self
[in]ik- same as sym_k.ik
[in]lk- same as sym_k.lk

◆ RaveIOCache_getUserBlock()

unsigned long long RaveIOCache_getUserBlock ( RaveIOCache_t * iocache)

Returns the user block.

Parameters
[in]iocache- self
Returns
the user block

◆ RaveIOCache_loadField()

RaveField_t * RaveIOCache_loadField ( RaveIOCache_t * iocache,
const char * filename,
const char * fieldname )

Opens a supported HDF5 file and loads it into the RaveIOCache instance.

Parameters
[in]iocache- self
[in]filename- name of file to read
[in]fieldname- name of field (/fieldX) to load, if NULL, /field1 is read.
Returns
The rave field instance on success, otherwise NULL.

Opens a supported HDF5 file and loads it into the RaveIOCache instance.

Parameters
[in]vp- the vertical profile to be added to a node list
[in]nodelist- the nodelist the nodes should be added to
Returns
1 on success otherwise 0

◆ RaveIOCache_saveField()

int RaveIOCache_saveField ( RaveIOCache_t * iocache,
RaveField_t * obj,
const char * filename )

Saves a rave object as specified.

Parameters
[in]iocache- self
[in]obj- the field to save
[in]filename- the filename to save with.
Returns
1 on success, otherwise 0

◆ RaveIOCache_setCompressionLevel()

void RaveIOCache_setCompressionLevel ( RaveIOCache_t * iocache,
int lvl )

Sets the compression level.

Parameters
[in]iocache- self
[in]lvl- the compression level (0..9)

◆ RaveIOCache_setIStoreK()

void RaveIOCache_setIStoreK ( RaveIOCache_t * iocache,
long k )

Sets the istore_k value.

Parameters
[in]iocache- self
[in]k- the istore_k value

◆ RaveIOCache_setMetaBlockSize()

void RaveIOCache_setMetaBlockSize ( RaveIOCache_t * iocache,
long sz )

Sets the meta block size.

Parameters
[in]iocache- self
[in]sz- the meta block size

◆ RaveIOCache_setSizes()

void RaveIOCache_setSizes ( RaveIOCache_t * iocache,
size_t sz,
size_t addr )

Sets the sizes.

Parameters
[in]iocache- self
[in]sz- same as sizes.sizeof_size
[in]addr- same as sizes.sizeof_addr

◆ RaveIOCache_setSymk()

void RaveIOCache_setSymk ( RaveIOCache_t * iocache,
int ik,
int lk )

Sets the symk.

Parameters
[in]iocache- self
[in]ik- same as sym_k.ik
[in]lk- same as sym_k.lk

◆ RaveIOCache_setUserBlock()

void RaveIOCache_setUserBlock ( RaveIOCache_t * iocache,
unsigned long long userblock )

Sets the user block.

Parameters
[in]iocache- self
[in]userblock- the user block

Variable Documentation

◆ RaveIOCache_TYPE

RaveCoreObjectType RaveIOCache_TYPE
extern

Type definition to use when creating a rave object.