Template Function lvr2::hdf5util::createDataset

Function Documentation

template<typename T>
std::unique_ptr<HighFive::DataSet> lvr2::hdf5util::createDataset(HighFive::Group &g, std::string datasetName, const HighFive::DataSpace &dataSpace, const HighFive::DataSetCreateProps &properties)

Create a Hdf5 Dataset savely. Special behaviors over the normal HighFive::Group.createDataset:

  • If there is an existing dataset of same type and shape: -> return it instead of a new constructed

  • If there is an existing dataset of same type but different shape: -> try to resize the dataset and return the result

  • If there is an existing dataset of different type -> need to delete the dataset

  • Else: -> same behavior as HighFive::Group::createDataset

Template Parameters:

T

Parameters:
  • g

  • datasetName

  • dataSpace

  • properties

Returns:

std::unique_ptr<HighFive::DataSet>