radarlib 1.4.6
OdimH5v20::HDF5Attribute Class Reference

HDF5Attribute class. More...

#include <radarlib/odimh5v20_hdf5.hpp>

Static Public Member Functions

static H5::Attribute * get (H5::H5Object *obj, const char *name, bool mandatory)
 Get a HDF5 attribute.
 
static bool exists (H5::H5Object *obj, const char *name)
 Check if an HDF5 attribute exists.
 
static void remove (H5::H5Object *obj, const char *name)
 Delete an HDF5 attribute.
 
static std::string getName (H5::Attribute *attr)
 Get the name of a given attribute.
 
static void set (H5::H5Object *obj, const char *name, int64_t value)
 Set the value of an attribute.
 
static void set (H5::H5Object *obj, const char *name, double value)
 Set the value of an attribute.
 
static void set (H5::H5Object *obj, const char *name, const char *value)
 Set the value of an attribute.
 
static void set (H5::H5Object *obj, const char *name, const std::string &value)
 Set the value of an attribute.
 
static int64_t getLong (H5::H5Object *obj, const char *name)
 Get the value of a 64 bit int signed attribute attribute.
 
static int64_t getLong (H5::H5Object *obj, const char *name, int64_t defaultValue)
 Get the value of a 64 bit int signed attribute.
 
static double getDouble (H5::H5Object *obj, const char *name)
 Get the value of a 64 bit floating point attribute.
 
static double getDouble (H5::H5Object *obj, const char *name, double defaultValue)
 Get the value of a 64 bit floating point attribute.
 
static std::string getStr (H5::H5Object *obj, const char *name)
 Get the value of a string attribute.
 
static std::string getStr (H5::H5Object *obj, const char *name, const std::string &defaultValue)
 Get the value of a string attribute.
 

Detailed Description

HDF5Attribute class.

This is an internal class with methods to perform operations on HDF5 attributes

Member Function Documentation

◆ get()

H5::Attribute * OdimH5v20::HDF5Attribute::get ( H5::H5Object *  obj,
const char *  name,
bool  mandatory 
)
static

Get a HDF5 attribute.

Get the HDF5 attribute of an HDF5 object with the given name

Parameters
objthe hdf5 object
namethe attribute name
mandatorythrow exception if the attribute does not exists
Exceptions
OdimH5Exceptionif an unexpected error occurs
OdimH5MissingAttributeExceptionif mandatory is true and the attribute does not exists

◆ exists()

bool OdimH5v20::HDF5Attribute::exists ( H5::H5Object *  obj,
const char *  name 
)
static

Check if an HDF5 attribute exists.

Check if an HDF5 attribute exists for a given object

Parameters
objthe hdf5 object
namethe attribute name
Exceptions
OdimH5Exceptionif an unexpected error occurs

◆ remove()

void OdimH5v20::HDF5Attribute::remove ( H5::H5Object *  obj,
const char *  name 
)
static

Delete an HDF5 attribute.

Delete an HDF5 attribute from an HDF5 object

Parameters
objthe hdf5 object
namethe attribute name
Exceptions
OdimH5Exceptionif an unexpected error occurs

◆ getName()

std::string OdimH5v20::HDF5Attribute::getName ( H5::Attribute *  attr)
static

Get the name of a given attribute.

Get the name of a given attribute. This method is defined only to overcome a HDF5 library bug

Parameters
attrthe hdf5 attribute
Exceptions
OdimH5Exceptionif an unexpected error occurs

◆ set() [1/4]

void OdimH5v20::HDF5Attribute::set ( H5::H5Object *  obj,
const char *  name,
int64_t  value 
)
static

Set the value of an attribute.

Set the value of an attribute using the given 64 bit signed int value If the attribute does not exists it will be created If the attribute exists it will be erased and then recrated

Parameters
objthe hdf5 object
namethe attribute name
valuethe value to write into the attribute
Exceptions
OdimH5Exceptionif an unexpected error occurs

◆ set() [2/4]

void OdimH5v20::HDF5Attribute::set ( H5::H5Object *  obj,
const char *  name,
double  value 
)
static

Set the value of an attribute.

Set the value of an attribute using the given 64 bit floating point value If the attribute does not exists it will be created If the attribute exists it will be erased and then recrated

Parameters
objthe hdf5 object
namethe attribute name
valuethe value to write into the attribute
Exceptions
OdimH5Exceptionif an unexpected error occurs

◆ set() [3/4]

void OdimH5v20::HDF5Attribute::set ( H5::H5Object *  obj,
const char *  name,
const char *  value 
)
static

Set the value of an attribute.

Set the value of an attribute using the given string If the attribute does not exists it will be created If the attribute exists it will be erased and then recrated

Parameters
objthe hdf5 object
namethe attribute name
valuethe string to use
Exceptions
OdimH5Exceptionif an unexpected error occurs

◆ set() [4/4]

void OdimH5v20::HDF5Attribute::set ( H5::H5Object *  obj,
const char *  name,
const std::string &  value 
)
static

Set the value of an attribute.

Set the value of an attribute using the given std::string If the attribute does not exists it will be created If the attribute exists it will be erased and then recrated

Parameters
objthe hdf5 object
namethe attribute name
valuethe string to use
Exceptions
OdimH5Exceptionif an unexpected error occurs

◆ getLong() [1/2]

int64_t OdimH5v20::HDF5Attribute::getLong ( H5::H5Object *  obj,
const char *  name 
)
static

Get the value of a 64 bit int signed attribute attribute.

Get the value of a 64 bit signed int attribute

Parameters
objthe HDF5 object
namethe attribute name
Exceptions
OdimH5Exceptionif an unexpected error occurs
OdimH5MissingAttributeExceptionRaised if the attribute does not exists

◆ getLong() [2/2]

int64_t OdimH5v20::HDF5Attribute::getLong ( H5::H5Object *  obj,
const char *  name,
int64_t  defaultValue 
)
static

Get the value of a 64 bit int signed attribute.

Get the value of a 64 signed int attribute

Parameters
objthe hdf5 object
namethe attribute name
defaultValuethe value to return if the attribute does not exists
Exceptions
OdimH5Exceptionif an unexpected error occurs

◆ getDouble() [1/2]

double OdimH5v20::HDF5Attribute::getDouble ( H5::H5Object *  obj,
const char *  name 
)
static

Get the value of a 64 bit floating point attribute.

Get the value of a 64 bit floating point attribute

Parameters
objthe hdf5 object
namethe attribute name
Exceptions
OdimH5Exceptionif an unexpected error occurs
OdimH5MissingAttributeExceptionRaised if the attribute does not exists

◆ getDouble() [2/2]

double OdimH5v20::HDF5Attribute::getDouble ( H5::H5Object *  obj,
const char *  name,
double  defaultValue 
)
static

Get the value of a 64 bit floating point attribute.

Get the value of a 64 bit floating point attribute

Parameters
objthe hdf5 object
namethe attribute name
defaultValuethe value to return if the attribute does not exists
Exceptions
OdimH5Exceptionif an unexpected error occurs
OdimH5MissingAttributeExceptionRaised if the attribute does not exists

◆ getStr() [1/2]

std::string OdimH5v20::HDF5Attribute::getStr ( H5::H5Object *  obj,
const char *  name 
)
static

Get the value of a string attribute.

Get the value of a string attribute

Parameters
objthe hdf5 object
namethe attribute name
Exceptions
OdimH5Exceptionif an unexpected error occurs
OdimH5MissingAttributeExceptionRaised if the attribute does not exists

◆ getStr() [2/2]

std::string OdimH5v20::HDF5Attribute::getStr ( H5::H5Object *  obj,
const char *  name,
const std::string &  defaultValue 
)
static

Get the value of a string attribute.

Get the value of a string attribute

Parameters
objthe hdf5 object
namethe attribute name
defaultValuethe value to return if the attribute does not exists
Exceptions
OdimH5Exceptionif an unexpected error occurs
OdimH5MissingAttributeExceptionRaised if the attribute does not exists

The documentation for this class was generated from the following files: