icedb  version 0.5.1
Snow particle scattering database API
Namespaces | Macros | Typedefs | Enumerations | Functions
hdf5_supplemental.hpp File Reference
#include <memory>
#include <set>
#include <string>
#include <vector>
#include <functional>
#include <stdexcept>
#include <sstream>
#include <iostream>
#include "../icedb/compat/gsl/gsl"
#include "icedb_h5.h"
#include "hdf5_load.h"
#include "../icedb/fs.hpp"
#include "../icedb/util.hpp"
Include dependency graph for hdf5_supplemental.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 icedb
 
 icedb::fs
 
 icedb::fs::hdf5
 

Macros

#define INST_ATTR(y)
 
#define ARRAYOFFSET(TYPE, INDEX)   [](){TYPE a; return (size_t) &a[INDEX] - (size_t) &a; }()
 Provides a method for calculating the offsets from std::arrays of data. More...
 

Typedefs

typedef std::unique_ptr< H5::Group > icedb::fs::hdf5::HDFgroup_t
 
typedef std::unique_ptr< H5::AtomType > icedb::fs::hdf5::MatchAttributeTypeType
 
typedef std::unique_ptr< H5::DataSet > icedb::fs::hdf5::HDFdataset_t
 

Enumerations

enum  icedb::fs::hdf5::DataContainerType {
  icedb::fs::hdf5::DataContainerType::BASIC, icedb::fs::hdf5::DataContainerType::ARRAY, icedb::fs::hdf5::DataContainerType::COMPOUND, icedb::fs::hdf5::DataContainerType::ENUM,
  icedb::fs::hdf5::DataContainerType::OPAQUE, icedb::fs::hdf5::DataContainerType::VLEN, icedb::fs::hdf5::DataContainerType::STRING, icedb::fs::hdf5::DataContainerType::UNKNOWN
}
 

Functions

int icedb::fs::hdf5::useZLIB ()
 
void icedb::fs::hdf5::useZLIB (int val)
 
std::set< std::string > icedb::fs::hdf5::getGroupMembers (const ICEDB_H5_GETNUMOBJS_OWNER &base)
 
std::map< std::string, H5G_obj_t > icedb::fs::hdf5::getGroupMembersTypes (const ICEDB_H5_GETNUMOBJS_OWNER &base)
 
HDFgroup_t icedb::fs::hdf5::openOrCreateGroup (gsl::not_null< ICEDB_H5_GROUP_OWNER_PTR > base, gsl::not_null< const char *> name)
 
HDFgroup_t icedb::fs::hdf5::openGroup (gsl::not_null< ICEDB_H5_GROUP_OWNER_PTR > base, gsl::not_null< const char *> name)
 
bool icedb::fs::hdf5::groupExists (gsl::not_null< ICEDB_H5_GROUP_OWNER_PTR > base, gsl::not_null< const char *> name)
 
template<class DataType >
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType ()
 
template<>
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType< std::string > ()
 
template<>
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType< const char * > ()
 
template<>
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType< char > ()
 
template<>
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType< uint8_t > ()
 
template<>
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType< uint16_t > ()
 
template<>
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType< uint32_t > ()
 
template<>
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType< uint64_t > ()
 
template<>
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType< int8_t > ()
 
template<>
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType< int16_t > ()
 
template<>
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType< int32_t > ()
 
template<>
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType< int64_t > ()
 
template<>
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType< float > ()
 
template<>
MatchAttributeTypeType icedb::fs::hdf5::MatchAttributeType< double > ()
 
template<class DataType >
bool icedb::fs::hdf5::isStrType ()
 Check to see if output type is for a string. More...
 
template<>
bool icedb::fs::hdf5::isStrType< std::string > ()
 
template<>
bool icedb::fs::hdf5::isStrType< const char * > ()
 
template<class DataType >
void icedb::fs::hdf5::insertAttr (const H5::Attribute &attr, gsl::not_null< H5::AtomType *> vls_type, const DataType &value)
 Handles proper insertion of strings versus other data types. More...
 
template<>
void icedb::fs::hdf5::insertAttr< std::string > (const H5::Attribute &attr, gsl::not_null< H5::AtomType *> vls_type, const std::string &value)
 
template<class DataType , class Container >
void icedb::fs::hdf5::addAttr (gsl::not_null< Container *> obj, gsl::not_null< const char *> attname, const DataType &value)
 Convenient template to add an attribute of a variable type to a group or dataset. More...
 
template<class DataType , class Container >
void icedb::fs::hdf5::addAttrArray (gsl::not_null< Container *> obj, gsl::not_null< const char *> attname, const std::vector< size_t > &dimensionality, const std::vector< DataType > &value)
 Writes an array of objects. More...
 
template<class DataType , class Container >
void icedb::fs::hdf5::addAttrVector (gsl::not_null< Container *> obj, gsl::not_null< const char *> attname, const std::vector< DataType > &data)
 Writes a vector of objects. More...
 
template<class DataType >
void icedb::fs::hdf5::loadAttr (const H5::Attribute &attr, gsl::not_null< H5::AtomType *> vls_type, DataType &value)
 Handles proper insertion of strings versus other data types. More...
 
template<>
void icedb::fs::hdf5::loadAttr< std::string > (const H5::Attribute &attr, gsl::not_null< H5::AtomType *> vls_type, std::string &value)
 
template<class DataType , class Container >
void icedb::fs::hdf5::readAttr (gsl::not_null< Container *> obj, gsl::not_null< const char *> attname, DataType &value)
 Convenient template to read an attribute of a variable. More...
 
template<class DataType , class Container >
void icedb::fs::hdf5::readAttrArray (gsl::not_null< Container *> obj, gsl::not_null< const char *> attname, std::vector< size_t > &dims, std::vector< DataType > &value)
 Reads an array (or vector) of objects. More...
 
template<class DataType , class Container >
void icedb::fs::hdf5::readAttrVector (gsl::not_null< Container *> obj, gsl::not_null< const char *> attname, std::vector< DataType > &value)
 Reads an array (or vector) of objects. More...
 
template<class Container >
DataContainerType icedb::fs::hdf5::getAttributeGroupingType (gsl::not_null< Container *> obj, gsl::not_null< const char *> attname)
 
template<class Container >
std::vector< hsize_t > icedb::fs::hdf5::getAttrArrayDimensionality (gsl::not_null< Container *> obj, gsl::not_null< const char *> attname)
 
bool icedb::fs::hdf5::attrExists (gsl::not_null< H5::H5Object *> base, gsl::not_null< const char *> name)
 
std::pair< bool, bool > icedb::fs::hdf5::symLinkExists (gsl::not_null< ICEDB_H5_GROUP_OWNER_PTR > base, gsl::not_null< const char *> name)
 
bool icedb::fs::hdf5::datasetExists (gsl::not_null< ICEDB_H5_GROUP_OWNER_PTR > base, gsl::not_null< const char * > name)
 Convenience function to check if a given dataset exists. More...
 
template<class DataType , class Container >
HDFdataset_t icedb::fs::hdf5::addDatasetArray (gsl::not_null< Container *> obj, gsl::not_null< const char *> name, size_t rows, size_t cols, gsl::not_null< const DataType *> values, std::shared_ptr< H5::DSetCreatPropList > iplist=nullptr)
 
template<class DataType , class Container >
HDFdataset_t icedb::fs::hdf5::addDatasetArray (gsl::not_null< Container *> obj, gsl::not_null< const char *> name, size_t rows, gsl::not_null< const DataType *> values, std::shared_ptr< H5::DSetCreatPropList > iplist=nullptr)
 
template<class DataType , class Container >
gsl::not_null< H5::DataSet * > icedb::fs::hdf5::writeDatasetArray (const std::vector< size_t > &dimensions, gsl::not_null< H5::DataSet *> dset, gsl::not_null< const DataType *> values)
 
template<class DataType , class Container >
HDFdataset_t icedb::fs::hdf5::createDatasetRaw (gsl::not_null< Container *> parent, gsl::not_null< const char *> name, const std::vector< size_t > &dims, std::shared_ptr< H5::DSetCreatPropList > iplist=nullptr)
 
template<class Container >
HDFdataset_t icedb::fs::hdf5::readDatasetDimensions (gsl::not_null< Container *> obj, gsl::not_null< const char *> name, std::vector< size_t > &out)
 
void icedb::fs::hdf5::readDatasetDimensions (gsl::not_null< H5::DataSet *> dataset, std::vector< size_t > &dims)
 
size_t icedb::fs::hdf5::readDatasetNumDimensions (gsl::not_null< H5::DataSet *> dataset)
 
template<class DataType , class Container >
HDFdataset_t icedb::fs::hdf5::readDatasetArray (gsl::not_null< Container *> obj, gsl::not_null< const char *> name, gsl::not_null< DataType *> values)
 
template<class DataType , class Container >
gsl::not_null< Container * > icedb::fs::hdf5::readDatasetArray (gsl::not_null< Container *> dataset, gsl::not_null< DataType *> values)
 
template<class Container >
void icedb::fs::hdf5::addNames (gsl::not_null< Container *> obj, const std::string &prefix, size_t num, const std::function< std::string(int)> &s, size_t stride=0, size_t mCols=0)
 Add column names to table. More...
 
template<class Container >
void icedb::fs::hdf5::addColNames (gsl::not_null< Container *> obj, size_t num, const std::function< std::string(int)> &s, size_t stride=0, size_t mCols=0)
 Add column names to table. More...
 
std::shared_ptr< H5::DSetCreatPropList > icedb::fs::hdf5::make_plist (size_t rows, size_t cols, bool compress=true)
 Creates a property list with the compression + chunking as specified. More...
 
std::vector< std::string > icedb::fs::hdf5::explode (std::string const &s, char delim)
 
std::vector< std::string > icedb::fs::hdf5::explodeHDF5groupPath (const std::string &s)
 
H5::Group icedb::fs::hdf5::createGroupStructure (const std::string &groupName, ICEDB_H5_GROUP_OWNER &base)
 
H5::Group icedb::fs::hdf5::createGroupStructure (const std::vector< std::string > &groups, ICEDB_H5_GROUP_OWNER &base)
 
unsigned int icedb::fs::hdf5::getHDF5IOflags (fs::IOopenFlags flags)
 
template<class DataType >
bool icedb::fs::hdf5::isType (hid_t)
 Functions to detect the type of data. More...
 
template<class DataType , class Container >
bool icedb::fs::hdf5::isType (gsl::not_null< const Container *> obj, const std::string &attributeName)
 
template<class DataType , class Container >
bool icedb::fs::hdf5::isType (gsl::not_null< const Container *> obj)
 
template<>
bool icedb::fs::hdf5::isType< uint64_t > (hid_t type_id)
 
template<>
bool icedb::fs::hdf5::isType< int64_t > (hid_t type_id)
 
template<>
bool icedb::fs::hdf5::isType< uint32_t > (hid_t type_id)
 
template<>
bool icedb::fs::hdf5::isType< int32_t > (hid_t type_id)
 
template<>
bool icedb::fs::hdf5::isType< uint16_t > (hid_t type_id)
 
template<>
bool icedb::fs::hdf5::isType< int16_t > (hid_t type_id)
 
template<>
bool icedb::fs::hdf5::isType< uint8_t > (hid_t type_id)
 
template<>
bool icedb::fs::hdf5::isType< int8_t > (hid_t type_id)
 
template<>
bool icedb::fs::hdf5::isType< float > (hid_t type_id)
 
template<>
bool icedb::fs::hdf5::isType< double > (hid_t type_id)
 
template<>
bool icedb::fs::hdf5::isType< char > (hid_t type_id)
 
template<>
bool icedb::fs::hdf5::isType< std::string > (hid_t type_id)
 

Macro Definition Documentation

◆ ARRAYOFFSET

#define ARRAYOFFSET (   TYPE,
  INDEX 
)    [](){TYPE a; return (size_t) &a[INDEX] - (size_t) &a; }()

Provides a method for calculating the offsets from std::arrays of data.

Definition at line 38 of file hdf5_supplemental.hpp.

◆ INST_ATTR

#define INST_ATTR (   y)
Value:
y(double); \
y(float); \
y(uint64_t); \
y(int64_t); \
y(uint32_t); \
y(int32_t); \
y(uint16_t); \
y(int16_t); \
y(uint8_t); \
y(int8_t); \
y(char); \
y(std::string);

Definition at line 17 of file hdf5_supplemental.hpp.