Field3D
Hdf5Util.h File Reference

Contains various utility functions for Hdf5. More...

#include <string>
#include <exception>
#include <vector>
#include <boost/lexical_cast.hpp>
#include <hdf5.h>
#include "Exception.h"
#include "Traits.h"
#include "Field.h"
#include "ns.h"

Go to the source code of this file.

Classes

class  Hdf5Util::H5Base
 Base class for all scoped Hdf5 util classes. More...
 
class  Hdf5Util::H5ScopedAget_space
 Scoped object - opens an attribute data space on creation and closes it on destruction. More...
 
class  Hdf5Util::H5ScopedAget_type
 Scoped object - opens an attribute data type on creation and closes it on destruction. More...
 
class  Hdf5Util::H5ScopedAopen
 Scoped object - Opens attribute by name and closes it on destruction. More...
 
class  Hdf5Util::H5ScopedAopenIdx
 Scoped object - Opens attribute by index and closes it on destruction. More...
 
class  Hdf5Util::H5ScopedDcreate
 Scoped object - creates a dataset on creation and closes it on destruction. More...
 
class  Hdf5Util::H5ScopedDget_space
 Scoped object - opens a dataset on creation and closes it on destruction. More...
 
class  Hdf5Util::H5ScopedDget_type
 Scoped object - opens a dataset on creation and closes it on destruction. More...
 
class  Hdf5Util::H5ScopedDopen
 Scoped object - opens a dataset on creation and closes it on destruction. More...
 
class  Hdf5Util::H5ScopedGcreate
 Scoped object - creates a group on creation and closes it on destruction. More...
 
class  Hdf5Util::H5ScopedGopen
 Scoped object - opens a group on creation and closes it on destruction. More...
 
class  Hdf5Util::H5ScopedScreate
 Scoped object - creates a dataspace on creation and closes it on destruction. More...
 
class  Hdf5Util::H5ScopedTget_native_type
 Scoped object - opens an native type id on creation and closes it on destruction. More...
 

Namespaces

 Hdf5Util
 Contains utility functions and classes for Hdf5 files.
 

Constant Groups

 Hdf5Util
 Contains utility functions and classes for Hdf5 files.
 

Functions

bool Hdf5Util::checkHdf5Gzip ()
 Checks whether gzip is available in the current hdf5 library. More...
 
Read/write simple data to hdf5 location
template<typename T >
void Hdf5Util::writeSimpleData (hid_t location, const std::string &name, const std::vector< T > &data)
 Writes a simple linear data set to the given location. More...
 
template<typename T >
void Hdf5Util::readSimpleData (hid_t location, const std::string &name, std::vector< T > &data)
 Reads a simple linear data set from the given location. More...
 
Attribute reading
bool Hdf5Util::readAttribute (hid_t location, const std::string &attrName, std::string &value)
 Reads a string attribute. More...
 
bool Hdf5Util::readAttribute (hid_t location, const std::string &attrName, unsigned int attrSize, int &value)
 Reads an int attribute of arbitrary size. More...
 
bool Hdf5Util::readAttribute (hid_t location, const std::string &attrName, unsigned int attrSize, float &value)
 Reads a float attribute of arbitrary size. More...
 
bool Hdf5Util::readAttribute (hid_t location, const std::string &attrName, unsigned int attrSize, double &value)
 Reads a double attribute of arbitrary size. More...
 
bool Hdf5Util::readAttribute (hid_t location, const std::string &attrName, std::vector< unsigned int > &attrSize, int &value)
 Reads a int attribute of arbitrary size and rank. More...
 
bool Hdf5Util::readAttribute (hid_t location, const std::string &attrName, std::vector< unsigned int > &attrSize, float &value)
 Reads a float attribute of arbitrary size and rank. More...
 
bool Hdf5Util::readAttribute (hid_t location, const std::string &attrName, std::vector< unsigned int > &attrSize, double &value)
 Reads a double attribute of arbitrary size and rank. More...
 
Attribute writing
bool Hdf5Util::writeAttribute (hid_t location, const std::string &attrName, const std::string &value)
 Writes a string attribute. More...
 
bool Hdf5Util::writeAttribute (hid_t location, const std::string &attrName, unsigned int attrSize, const int &value)
 Writes an int attribute of arbitrary size. More...
 
bool Hdf5Util::writeAttribute (hid_t location, const std::string &attrName, unsigned int attrSize, const float &value)
 Writes a float attribute of arbitrary size. More...
 
bool Hdf5Util::writeAttribute (hid_t location, const std::string &attrName, unsigned int attrSize, const double &value)
 Writes a double attribute of arbitrary size. More...
 
bool Hdf5Util::writeAttribute (hid_t location, const std::string &attrName, std::vector< unsigned int > &attrSize, const int &value)
 Writes a float attribute of arbitrary size and rank. More...
 
bool Hdf5Util::writeAttribute (hid_t location, const std::string &attrName, std::vector< unsigned int > &attrSize, const float &value)
 Writes a float attribute of arbitrary size and rank. More...
 
bool Hdf5Util::writeAttribute (hid_t location, const std::string &attrName, std::vector< unsigned int > &attrSize, const double &value)
 Writes a double attribute of arbitrary size and rank. More...
 

Detailed Description

Contains various utility functions for Hdf5.

Todo:
Clean up the attribute read/write functions. Make them throw exceptions when failing.

Definition in file Hdf5Util.h.