MUQ  0.4.3
muq::Utilities::H5Object Class Reference

#include <H5Object.h>

Detailed Description

Definition at line 53 of file H5Object.h.

Public Types

typedef std::function< void(boost::any const &, H5Object &)> AnyWriterType
 
typedef std::unordered_map< std::type_index, AnyWriterTypeAnyWriterMapType
 

Public Member Functions

 H5Object ()
 
 H5Object (std::shared_ptr< HDF5File > file_, std::string const &path_, bool isDataset_)
 
H5Objectoperator= (boost::any const &val)
 
template<typename ScalarType , typename = typename std::enable_if<std::is_arithmetic<ScalarType>::value, ScalarType>::type>
H5Objectoperator= (ScalarType val)
 
template<typename Derived >
H5Objectoperator= (Eigen::DenseBase< Derived > const &val)
 
template<typename ScalarType , int fixedRows, int fixedCols>
H5Objectoperator= (Eigen::Matrix< ScalarType, fixedRows, fixedCols > const &val)
 
H5Objectoperator= (H5Object const &otherObj)
 Performs a deep copy of the datasets and groups in otherObj into this object. More...
 
template<typename scalarType = double, int rows = Eigen::Dynamic, int cols = Eigen::Dynamic>
Eigen::Matrix< scalarType, rows, colseval ()
 
H5ObjectCreatePlaceholder (std::string const &grpName)
 
H5ObjectCreateGroup (std::string const &grpName)
 
template<typename ScalarType >
H5ObjectCreateDataset (std::string const &setName, unsigned int rows, unsigned int cols=0)
 
H5Objectoperator[] (std::string const &targetPath)
 
BlockDataset block (unsigned startRow, unsigned startCol, unsigned numRows, unsigned numCols) const
 
BlockDataset topLeftCorner (unsigned numRows, unsigned numCols) const
 
BlockDataset bottomLeftCorner (unsigned numRows, unsigned numCols) const
 
BlockDataset topRightCorner (unsigned numRows, unsigned numCols) const
 
BlockDataset bottomRightCorner (unsigned numRows, unsigned numCols) const
 
BlockDataset topRows (unsigned numRows) const
 
BlockDataset bottomRows (unsigned numRows) const
 
BlockDataset leftCols (unsigned numCols) const
 
BlockDataset rightCols (unsigned numCols) const
 
BlockDataset col (unsigned col) const
 
BlockDataset row (unsigned row) const
 
BlockDataset segment (unsigned startInd, unsigned numInds) const
 
BlockDataset head (unsigned numInds) const
 
BlockDataset tail (unsigned numInds) const
 
unsigned rows () const
 
unsigned cols () const
 
unsigned size () const
 
double operator() (int i) const
 
double operator() (int i, int j) const
 
void Flush ()
 
void Print (std::string prefix="") const
 
std::string Path () const
 

Static Public Member Functions

static std::shared_ptr< AnyWriterMapTypeGetAnyWriterMap ()
 

Public Attributes

std::shared_ptr< HDF5Filefile
 
AttributeList attrs
 

Friends

H5Object muq::Utilities::AddChildren (std::shared_ptr< HDF5File > file, std::string const &path)
 

Member Typedef Documentation

◆ AnyWriterMapType

typedef std::unordered_map<std::type_index, AnyWriterType> muq::Utilities::H5Object::AnyWriterMapType

Definition at line 69 of file H5Object.h.

◆ AnyWriterType

typedef std::function<void(boost::any const&, H5Object& )> muq::Utilities::H5Object::AnyWriterType

Definition at line 68 of file H5Object.h.

Constructor & Destructor Documentation

◆ H5Object() [1/2]

muq::Utilities::H5Object::H5Object ( )
inline

Definition at line 59 of file H5Object.h.

Referenced by CreateGroup(), and CreatePlaceholder().

◆ H5Object() [2/2]

muq::Utilities::H5Object::H5Object ( std::shared_ptr< HDF5File file_,
std::string const &  path_,
bool  isDataset_ 
)
inline

Definition at line 61 of file H5Object.h.

Member Function Documentation

◆ block()

BlockDataset H5Object::block ( unsigned  startRow,
unsigned  startCol,
unsigned  numRows,
unsigned  numCols 
) const

◆ bottomLeftCorner()

BlockDataset H5Object::bottomLeftCorner ( unsigned  numRows,
unsigned  numCols 
) const

Definition at line 140 of file H5Object.cpp.

References block(), and rows().

◆ bottomRightCorner()

BlockDataset H5Object::bottomRightCorner ( unsigned  numRows,
unsigned  numCols 
) const

Definition at line 150 of file H5Object.cpp.

References block(), cols(), and rows().

◆ bottomRows()

BlockDataset H5Object::bottomRows ( unsigned  numRows) const

Definition at line 160 of file H5Object.cpp.

References block(), and cols().

◆ col()

BlockDataset H5Object::col ( unsigned  col) const

Definition at line 175 of file H5Object.cpp.

References block(), file, isDataset, and path.

◆ cols()

unsigned H5Object::cols ( ) const

◆ CreateDataset()

template<typename ScalarType >
H5Object& muq::Utilities::H5Object::CreateDataset ( std::string const &  setName,
unsigned int  rows,
unsigned int  cols = 0 
)
inline

Creates a dataset with a particular size and type.

Definition at line 145 of file H5Object.h.

References cols(), CreatePlaceholder(), file, path, and rows().

Referenced by muq::Approximation::BasisExpansion::ToHDF5(), and muq::Utilities::MultiIndexSet::ToHDF5().

◆ CreateGroup()

H5Object & H5Object::CreateGroup ( std::string const &  grpName)

Definition at line 56 of file H5Object.cpp.

References children, file, H5Object(), path, and muq::Utilities::SplitString().

◆ CreatePlaceholder()

H5Object & H5Object::CreatePlaceholder ( std::string const &  grpName)

Definition at line 29 of file H5Object.cpp.

References children, file, H5Object(), path, and muq::Utilities::SplitString().

Referenced by CreateDataset(), and operator[]().

◆ DeepCopy()

void H5Object::DeepCopy ( H5Object const &  otherObj)
private

Definition at line 6 of file H5Object.cpp.

References children, file, isDataset, and path.

Referenced by operator=().

◆ eval()

template<typename scalarType = double, int rows = Eigen::Dynamic, int cols = Eigen::Dynamic>
Eigen::Matrix<scalarType,rows,cols> muq::Utilities::H5Object::eval ( )
inline

Definition at line 126 of file H5Object.h.

References cols(), file, isDataset, path, and rows().

Referenced by operator=().

◆ ExactCopy()

void H5Object::ExactCopy ( H5Object const &  otherObj)
private

Creates an exact copy.

Equivalent to the default assignment operator. Does not copy datasets, only the path, children, and isDataset values from another H5Object.

Definition at line 19 of file H5Object.cpp.

References attrs, children, file, isDataset, and path.

◆ Flush()

void H5Object::Flush ( )

Definition at line 275 of file H5Object.cpp.

References file.

◆ GetAnyWriterMap()

static std::shared_ptr<AnyWriterMapType> muq::Utilities::H5Object::GetAnyWriterMap ( )
static

◆ head()

BlockDataset H5Object::head ( unsigned  numInds) const

Definition at line 196 of file H5Object.cpp.

References block(), file, and path.

◆ leftCols()

BlockDataset H5Object::leftCols ( unsigned  numCols) const

Definition at line 165 of file H5Object.cpp.

References block(), and rows().

◆ operator()() [1/2]

double H5Object::operator() ( int  i) const

Definition at line 255 of file H5Object.cpp.

References file, isDataset, and path.

◆ operator()() [2/2]

double H5Object::operator() ( int  i,
int  j 
) const

Definition at line 264 of file H5Object.cpp.

References file, isDataset, and path.

◆ operator=() [1/5]

H5Object& muq::Utilities::H5Object::operator= ( boost::any const &  val)

◆ operator=() [2/5]

template<typename Derived >
H5Object& muq::Utilities::H5Object::operator= ( Eigen::DenseBase< Derived > const &  val)
inline

Definition at line 97 of file H5Object.h.

References eval().

◆ operator=() [3/5]

template<typename ScalarType , int fixedRows, int fixedCols>
H5Object& muq::Utilities::H5Object::operator= ( Eigen::Matrix< ScalarType, fixedRows, fixedCols > const &  val)
inline

Definition at line 103 of file H5Object.h.

References file, isDataset, and path.

◆ operator=() [4/5]

H5Object & H5Object::operator= ( H5Object const &  otherObj)

Performs a deep copy of the datasets and groups in otherObj into this object.

Definition at line 13 of file H5Object.cpp.

References DeepCopy().

◆ operator=() [5/5]

template<typename ScalarType , typename = typename std::enable_if<std::is_arithmetic<ScalarType>::value, ScalarType>::type>
H5Object& muq::Utilities::H5Object::operator= ( ScalarType  val)
inline

Definition at line 78 of file H5Object.h.

References file, isDataset, and path.

◆ operator[]()

H5Object & H5Object::operator[] ( std::string const &  targetPath)

Definition at line 84 of file H5Object.cpp.

References children, CreatePlaceholder(), isDataset, path, and muq::Utilities::SplitString().

◆ Path()

std::string muq::Utilities::H5Object::Path ( ) const
inline

Definition at line 201 of file H5Object.h.

References path.

Referenced by muq::Approximation::PolynomialChaosExpansion::FromHDF5().

◆ Print()

void H5Object::Print ( std::string  prefix = "") const

Definition at line 281 of file H5Object.cpp.

References children, and path.

◆ rightCols()

BlockDataset H5Object::rightCols ( unsigned  numCols) const

Definition at line 170 of file H5Object.cpp.

References block(), cols(), and rows().

◆ row()

BlockDataset H5Object::row ( unsigned  row) const

◆ rows()

unsigned H5Object::rows ( ) const

◆ segment()

BlockDataset H5Object::segment ( unsigned  startInd,
unsigned  numInds 
) const

Definition at line 191 of file H5Object.cpp.

References block().

◆ size()

unsigned H5Object::size ( ) const

Definition at line 246 of file H5Object.cpp.

References file, isDataset, and path.

◆ tail()

BlockDataset H5Object::tail ( unsigned  numInds) const

Definition at line 219 of file H5Object.cpp.

References block(), and rows().

◆ topLeftCorner()

BlockDataset H5Object::topLeftCorner ( unsigned  numRows,
unsigned  numCols 
) const

Definition at line 135 of file H5Object.cpp.

References block().

◆ topRightCorner()

BlockDataset H5Object::topRightCorner ( unsigned  numRows,
unsigned  numCols 
) const

Definition at line 145 of file H5Object.cpp.

References block(), and cols().

◆ topRows()

BlockDataset H5Object::topRows ( unsigned  numRows) const

Definition at line 155 of file H5Object.cpp.

References block(), and cols().

Friends And Related Function Documentation

◆ muq::Utilities::AddChildren

H5Object muq::Utilities::AddChildren ( std::shared_ptr< HDF5File file,
std::string const &  path 
)
friend

Member Data Documentation

◆ attrs

◆ children

std::map<std::string, H5Object> muq::Utilities::H5Object::children
private

◆ file

std::shared_ptr<HDF5File> muq::Utilities::H5Object::file

◆ isDataset

bool muq::Utilities::H5Object::isDataset
private

◆ path

std::string muq::Utilities::H5Object::path
private

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