RAVE
rave_iocache.c File Reference

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

#include <lazy_nodelist_reader.h>
#include "rave_iocache.h"
#include "rave_debug.h"
#include "rave_alloc.h"
#include "rave_types.h"
#include "rave_utilities.h"
#include "rave_data2d.h"
#include "hlhdf.h"
#include "hlhdf_alloc.h"
#include "hlhdf_debug.h"
#include "string.h"
#include "stdarg.h"
#include "raveobject_hashtable.h"
#include "raveobject_list.h"
#include "polarvolume.h"
#include "cartesianvolume.h"
#include "rave_field.h"
#include "rave_hlhdf_utilities.h"
#include "odim_io_utilities.h"

Classes

struct  _RaveIOCache_t
 Defines the structure for the RaveIOCache. More...
 

Functions

RaveField_tRaveIOCache_loadField (RaveIOCache_t *iocache, const char *filename, const char *fieldname)
 Adds a vertical profile to a node list.
 
int RaveIOCache_saveField (RaveIOCache_t *iocache, RaveField_t *field, 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

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 )

Adds a vertical profile to a node list.

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
Initial value:
= {
"RaveIOCache",
sizeof(RaveIOCache_t),
RaveIOCache_constructor,
RaveIOCache_destructor
}
struct _RaveIOCache_t RaveIOCache_t
Defines a Rave IO Cache instance.
Definition rave_iocache.h:35

Type definition to use when creating a rave object.