Public Member Functions | Public Attributes | List of all members
lvr2::HDF5Kernel Class Reference

#include <HDF5Kernel.hpp>

Inheritance diagram for lvr2::HDF5Kernel:
Inheritance graph
[legend]

Public Member Functions

template<typename T >
bool addChannel (const std::string group, const std::string name, const AttributeChannel< T > &channel) const
 
bool addChannel (const std::string group, const std::string name, const FloatChannel &channel) const
 addChannel Writes a float attribute channel from the given group with the given name More...
 
bool addChannel (const std::string group, const std::string name, const IndexChannel &channel) const
 addChannel Writes an index attribute channel from the given group with the given name More...
 
bool addChannel (const std::string group, const std::string name, const UCharChannel &channel) const
 addChannel Writes an unsigned char attribute channel from the given group with the given name More...
 
template<typename T >
cv::Mat createMat (const std::vector< size_t > &dims) const
 
virtual bool exists (const std::string &group) const
 
virtual bool exists (const std::string &group, const std::string &container) const
 
bool getChannel (const std::string group, const std::string name, FloatChannelOptional &channel) const
 getChannel Reads a float attribute channel in the given group with the given name More...
 
bool getChannel (const std::string group, const std::string name, IndexChannelOptional &channel) const
 getChannel Reads an index attribute channel in the given group with the given name More...
 
bool getChannel (const std::string group, const std::string name, UCharChannelOptional &channel) const
 getChannel Reads an unsigned char attribute channel in the given group with the given name More...
 
template<typename T >
bool getChannel (const std::string group, const std::string name, boost::optional< AttributeChannel< T >> &channel) const
 
 HDF5Kernel ()=delete
 
 HDF5Kernel (const std::string &hdf5file)
 
template<typename VariantChannelT >
boost::optional< VariantChannelT > load (std::string groupName, std::string datasetName) const
 
template<typename VariantChannelT >
boost::optional< VariantChannelT > load (HighFive::Group &group, std::string datasetName) const
 
template<typename T >
boost::shared_array< T > loadArray (const std::string &groupName, const std::string &datasetName, size_t &size) const
 
template<typename T >
boost::shared_array< T > loadArray (const std::string &groupName, const std::string &datasetName, std::vector< size_t > &dim) const
 
template<typename T >
ChannelOptional< T > loadChannelOptional (HighFive::Group &g, const std::string &datasetName) const
 
template<typename T >
ChannelOptional< T > loadChannelOptional (const std::string &groupName, const std::string &datasetName) const
 
virtual doubleArr loadDoubleArray (const std::string &group, const std::string &container, std::vector< size_t > &dims) const
 
template<typename VariantChannelT >
boost::optional< VariantChannelT > loadDynamic (HighFive::DataType dtype, HighFive::Group &group, std::string name) const
 
virtual floatArr loadFloatArray (const std::string &group, const std::string &container, std::vector< size_t > &dims) const
 
virtual boost::optional< cv::Mat > loadImage (const std::string &group, const std::string &container) const
 
virtual MeshBufferPtr loadMeshBuffer (const std::string &group, const std::string container) const
 
void loadMetaData (const YAML::Node &node)
 
virtual void loadMetaYAML (const std::string &group, const std::string &container, YAML::Node &node) const
 
virtual PointBufferPtr loadPointBuffer (const std::string &group, const std::string &container) const
 
virtual ucharArr loadUCharArray (const std::string &group, const std::string &container, std::vector< size_t > &dims) const
 
template<typename VariantChannelT >
boost::optional< VariantChannelT > loadVariantChannel (std::string groupName, std::string datasetName) const
 
template<typename T >
void save (std::string groupName, std::string datasetName, const Channel< T > &channel) const
 
template<typename T >
void save (HighFive::Group &g, std::string datasetName, const Channel< T > &channel) const
 
template<typename T >
void save (HighFive::Group &g, std::string datasetName, const Channel< T > &channel, std::vector< hsize_t > &chunkSize) const
 
template<typename ... Tp>
void save (std::string groupName, std::string datasetName, const VariantChannel< Tp... > &vchannel) const
 
template<typename ... Tp>
void save (HighFive::Group &group, std::string datasetName, const VariantChannel< Tp... > &vchannel) const
 
template<typename T >
void saveArray (const std::string &groupName, const std::string &datasetName, const size_t &size, const boost::shared_array< T > data) const
 
template<typename T >
void saveArray (const std::string &groupName, const std::string &datasetName, const vector< size_t > &dim, const boost::shared_array< T > data) const
 
virtual void saveDoubleArray (const std::string &groupName, const std::string &datasetName, const std::vector< size_t > &dimensions, const boost::shared_array< double > &data) const
 
template<typename ... Tp>
void saveDynamic (HighFive::Group &group, std::string datasetName, const VariantChannel< Tp... > &vchannel) const
 
virtual void saveFloatArray (const std::string &groupName, const std::string &datasetName, const std::vector< size_t > &dimensions, const boost::shared_array< float > &data) const
 
virtual void saveImage (const std::string &group, const std::string &container, const cv::Mat &image) const
 
virtual void saveMeshBuffer (const std::string &group, const std::string &container, const MeshBufferPtr &buffer) const
 
virtual void saveMetaYAML (const std::string &group, const std::string &metaName, const YAML::Node &node) const
 
virtual void savePointBuffer (const std::string &group, const std::string &container, const PointBufferPtr &buffer) const
 
virtual void saveUCharArray (const std::string &groupName, const std::string &datasetName, const std::vector< size_t > &dimensions, const boost::shared_array< unsigned char > &data) const
 
virtual void subGroupNames (const std::string &group, std::vector< string > &subGroupNames) const
 
virtual void subGroupNames (const std::string &group, const std::regex &filter, std::vector< string > &subGroupNames) const
 
 ~HDF5Kernel ()
 
- Public Member Functions inherited from lvr2::FileKernel
 FileKernel ()=delete
 
 FileKernel (const std::string &res)
 

Public Attributes

std::shared_ptr< HighFive::Filem_hdf5File
 
HDF5MetaDescriptionBasem_metaDescription
 

Additional Inherited Members

- Protected Attributes inherited from lvr2::FileKernel
std::string m_fileResourceName
 

Detailed Description

Definition at line 19 of file HDF5Kernel.hpp.

Constructor & Destructor Documentation

◆ HDF5Kernel() [1/2]

lvr2::HDF5Kernel::HDF5Kernel ( )
delete

◆ HDF5Kernel() [2/2]

lvr2::HDF5Kernel::HDF5Kernel ( const std::string &  hdf5file)

Definition at line 9 of file HDF5Kernel.cpp.

◆ ~HDF5Kernel()

lvr2::HDF5Kernel::~HDF5Kernel ( )
inline

Definition at line 25 of file HDF5Kernel.hpp.

Member Function Documentation

◆ addChannel() [1/4]

template<typename T >
bool lvr2::HDF5Kernel::addChannel ( const std::string  group,
const std::string  name,
const AttributeChannel< T > &  channel 
) const

◆ addChannel() [2/4]

bool lvr2::HDF5Kernel::addChannel ( const std::string  group,
const std::string  name,
const FloatChannel channel 
) const

addChannel Writes a float attribute channel from the given group with the given name

Parameters
groupThe associated attribute group
nameThe associated attribute name
channelThe pointer to the float channel which should be written
Returns
true if the channel has been written successfully, false otherwise

Definition at line 504 of file HDF5Kernel.cpp.

◆ addChannel() [3/4]

bool lvr2::HDF5Kernel::addChannel ( const std::string  group,
const std::string  name,
const IndexChannel channel 
) const

addChannel Writes an index attribute channel from the given group with the given name

Parameters
groupThe associated attribute group
nameThe associated attribute name
channelThe pointer to the index channel which should be written
Returns
true if the channel has been written successfully, false otherwise

◆ addChannel() [4/4]

bool lvr2::HDF5Kernel::addChannel ( const std::string  group,
const std::string  name,
const UCharChannel channel 
) const

addChannel Writes an unsigned char attribute channel from the given group with the given name

Parameters
groupThe associated attribute group
nameThe associated attribute name
channelThe pointer to the unsigned char channel which should be written
Returns
true if the channel has been written successfully, false otherwise

◆ createMat()

template<typename T >
cv::Mat lvr2::HDF5Kernel::createMat ( const std::vector< size_t > &  dims) const

◆ exists() [1/2]

bool lvr2::HDF5Kernel::exists ( const std::string &  group) const
virtual

Implements lvr2::FileKernel.

Definition at line 463 of file HDF5Kernel.cpp.

◆ exists() [2/2]

bool lvr2::HDF5Kernel::exists ( const std::string &  group,
const std::string &  container 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 468 of file HDF5Kernel.cpp.

◆ getChannel() [1/4]

bool lvr2::HDF5Kernel::getChannel ( const std::string  group,
const std::string  name,
FloatChannelOptional channel 
) const

getChannel Reads a float attribute channel in the given group with the given name

Parameters
groupThe associated attribute group
nameThe associated attribute name
channelThe pointer to the float channel
Returns
true if the channel has been loaded successfully, false otherwise

Definition at line 486 of file HDF5Kernel.cpp.

◆ getChannel() [2/4]

bool lvr2::HDF5Kernel::getChannel ( const std::string  group,
const std::string  name,
IndexChannelOptional channel 
) const

getChannel Reads an index attribute channel in the given group with the given name

Parameters
groupThe associated attribute group
nameThe associated attribute name
channelThe pointer to the index channel
Returns
true if the channel has been loaded successfully, false otherwise

Definition at line 492 of file HDF5Kernel.cpp.

◆ getChannel() [3/4]

bool lvr2::HDF5Kernel::getChannel ( const std::string  group,
const std::string  name,
UCharChannelOptional channel 
) const

getChannel Reads an unsigned char attribute channel in the given group with the given name

Parameters
groupThe associated attribute group
nameThe associated attribute name
channelThe pointer to the unsigned char channel
Returns
true if the channel has been loaded successfully, false otherwise

◆ getChannel() [4/4]

template<typename T >
bool lvr2::HDF5Kernel::getChannel ( const std::string  group,
const std::string  name,
boost::optional< AttributeChannel< T >> &  channel 
) const

◆ load() [1/2]

template<typename VariantChannelT >
boost::optional<VariantChannelT> lvr2::HDF5Kernel::load ( std::string  groupName,
std::string  datasetName 
) const

◆ load() [2/2]

template<typename VariantChannelT >
boost::optional<VariantChannelT> lvr2::HDF5Kernel::load ( HighFive::Group group,
std::string  datasetName 
) const

◆ loadArray() [1/2]

template<typename T >
boost::shared_array<T> lvr2::HDF5Kernel::loadArray ( const std::string &  groupName,
const std::string &  datasetName,
size_t &  size 
) const

◆ loadArray() [2/2]

template<typename T >
boost::shared_array<T> lvr2::HDF5Kernel::loadArray ( const std::string &  groupName,
const std::string &  datasetName,
std::vector< size_t > &  dim 
) const

◆ loadChannelOptional() [1/2]

template<typename T >
ChannelOptional<T> lvr2::HDF5Kernel::loadChannelOptional ( HighFive::Group g,
const std::string &  datasetName 
) const

◆ loadChannelOptional() [2/2]

template<typename T >
ChannelOptional<T> lvr2::HDF5Kernel::loadChannelOptional ( const std::string &  groupName,
const std::string &  datasetName 
) const

◆ loadDoubleArray()

doubleArr lvr2::HDF5Kernel::loadDoubleArray ( const std::string &  group,
const std::string &  container,
std::vector< size_t > &  dims 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 430 of file HDF5Kernel.cpp.

◆ loadDynamic()

template<typename VariantChannelT >
boost::optional<VariantChannelT> lvr2::HDF5Kernel::loadDynamic ( HighFive::DataType  dtype,
HighFive::Group group,
std::string  name 
) const

◆ loadFloatArray()

floatArr lvr2::HDF5Kernel::loadFloatArray ( const std::string &  group,
const std::string &  container,
std::vector< size_t > &  dims 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 422 of file HDF5Kernel.cpp.

◆ loadImage()

boost::optional< cv::Mat > lvr2::HDF5Kernel::loadImage ( const std::string &  group,
const std::string &  container 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 282 of file HDF5Kernel.cpp.

◆ loadMeshBuffer()

MeshBufferPtr lvr2::HDF5Kernel::loadMeshBuffer ( const std::string &  group,
const std::string  container 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 224 of file HDF5Kernel.cpp.

◆ loadMetaData()

void lvr2::HDF5Kernel::loadMetaData ( const YAML::Node &  node)

Definition at line 358 of file HDF5Kernel.cpp.

◆ loadMetaYAML()

void lvr2::HDF5Kernel::loadMetaYAML ( const std::string &  group,
const std::string &  container,
YAML::Node &  node 
) const
virtual

That we don't return the YAML node is on purpose to use the initial structure to look for the fields that should be loaded!

Implements lvr2::FileKernel.

Definition at line 363 of file HDF5Kernel.cpp.

◆ loadPointBuffer()

PointBufferPtr lvr2::HDF5Kernel::loadPointBuffer ( const std::string &  group,
const std::string &  container 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 231 of file HDF5Kernel.cpp.

◆ loadUCharArray()

ucharArr lvr2::HDF5Kernel::loadUCharArray ( const std::string &  group,
const std::string &  container,
std::vector< size_t > &  dims 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 414 of file HDF5Kernel.cpp.

◆ loadVariantChannel()

template<typename VariantChannelT >
boost::optional<VariantChannelT> lvr2::HDF5Kernel::loadVariantChannel ( std::string  groupName,
std::string  datasetName 
) const

◆ save() [1/5]

template<typename T >
void lvr2::HDF5Kernel::save ( std::string  groupName,
std::string  datasetName,
const Channel< T > &  channel 
) const

◆ save() [2/5]

template<typename T >
void lvr2::HDF5Kernel::save ( HighFive::Group g,
std::string  datasetName,
const Channel< T > &  channel 
) const

◆ save() [3/5]

template<typename T >
void lvr2::HDF5Kernel::save ( HighFive::Group g,
std::string  datasetName,
const Channel< T > &  channel,
std::vector< hsize_t > &  chunkSize 
) const

◆ save() [4/5]

template<typename ... Tp>
void lvr2::HDF5Kernel::save ( std::string  groupName,
std::string  datasetName,
const VariantChannel< Tp... > &  vchannel 
) const

◆ save() [5/5]

template<typename ... Tp>
void lvr2::HDF5Kernel::save ( HighFive::Group group,
std::string  datasetName,
const VariantChannel< Tp... > &  vchannel 
) const

◆ saveArray() [1/2]

template<typename T >
void lvr2::HDF5Kernel::saveArray ( const std::string &  groupName,
const std::string &  datasetName,
const size_t &  size,
const boost::shared_array< T >  data 
) const

◆ saveArray() [2/2]

template<typename T >
void lvr2::HDF5Kernel::saveArray ( const std::string &  groupName,
const std::string &  datasetName,
const vector< size_t > &  dim,
const boost::shared_array< T >  data 
) const

◆ saveDoubleArray()

void lvr2::HDF5Kernel::saveDoubleArray ( const std::string &  groupName,
const std::string &  datasetName,
const std::vector< size_t > &  dimensions,
const boost::shared_array< double > &  data 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 447 of file HDF5Kernel.cpp.

◆ saveDynamic()

template<typename ... Tp>
void lvr2::HDF5Kernel::saveDynamic ( HighFive::Group group,
std::string  datasetName,
const VariantChannel< Tp... > &  vchannel 
) const

◆ saveFloatArray()

void lvr2::HDF5Kernel::saveFloatArray ( const std::string &  groupName,
const std::string &  datasetName,
const std::vector< size_t > &  dimensions,
const boost::shared_array< float > &  data 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 438 of file HDF5Kernel.cpp.

◆ saveImage()

void lvr2::HDF5Kernel::saveImage ( const std::string &  group,
const std::string &  container,
const cv::Mat &  image 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 37 of file HDF5Kernel.cpp.

◆ saveMeshBuffer()

void lvr2::HDF5Kernel::saveMeshBuffer ( const std::string &  group,
const std::string &  container,
const MeshBufferPtr buffer 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 15 of file HDF5Kernel.cpp.

◆ saveMetaYAML()

void lvr2::HDF5Kernel::saveMetaYAML ( const std::string &  group,
const std::string &  metaName,
const YAML::Node &  node 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 178 of file HDF5Kernel.cpp.

◆ savePointBuffer()

void lvr2::HDF5Kernel::savePointBuffer ( const std::string &  group,
const std::string &  container,
const PointBufferPtr buffer 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 23 of file HDF5Kernel.cpp.

◆ saveUCharArray()

void lvr2::HDF5Kernel::saveUCharArray ( const std::string &  groupName,
const std::string &  datasetName,
const std::vector< size_t > &  dimensions,
const boost::shared_array< unsigned char > &  data 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 455 of file HDF5Kernel.cpp.

◆ subGroupNames() [1/2]

void lvr2::HDF5Kernel::subGroupNames ( const std::string &  group,
std::vector< string > &  subGroupNames 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 474 of file HDF5Kernel.cpp.

◆ subGroupNames() [2/2]

void lvr2::HDF5Kernel::subGroupNames ( const std::string &  group,
const std::regex &  filter,
std::vector< string > &  subGroupNames 
) const
virtual

Implements lvr2::FileKernel.

Definition at line 481 of file HDF5Kernel.cpp.

Member Data Documentation

◆ m_hdf5File

std::shared_ptr<HighFive::File> lvr2::HDF5Kernel::m_hdf5File

Definition at line 246 of file HDF5Kernel.hpp.

◆ m_metaDescription

HDF5MetaDescriptionBase* lvr2::HDF5Kernel::m_metaDescription

Definition at line 248 of file HDF5Kernel.hpp.


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


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:11