Skip to content

Commit

Permalink
Rename h5pp::scan::makeDsetInfo --> h5pp::scan::makeDsetInfo to clari…
Browse files Browse the repository at this point in the history
…fy intent
  • Loading branch information
DavidAce committed Oct 30, 2020
1 parent 6b4646a commit 5934a75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions h5pp/include/h5pp/details/h5ppFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ namespace h5pp {
h5pp::format("Error creating dataset [{}]: Dimensions or size not specified", options.linkPath.value()));
if(not options.h5Type)
throw std::runtime_error(h5pp::format("Error creating dataset [{}]: HDF5 type not specified", options.linkPath.value()));
auto dsetInfo = h5pp::scan::inferDsetInfo(openFileHandle(), options, plists);
auto dsetInfo = h5pp::scan::makeDsetInfo(openFileHandle(), options, plists);
h5pp::File::createDataset(dsetInfo);
return dsetInfo;
}
Expand Down Expand Up @@ -310,7 +310,7 @@ namespace h5pp {
DsetInfo createDataset(const DataType &data, const Options &options) {
if(permission == h5pp::FilePermission::READONLY)
throw std::runtime_error(h5pp::format("Attempted to create dataset on read-only file [{}]", filePath.string()));
auto dsetInfo = h5pp::scan::inferDsetInfo(openFileHandle(), data, options, plists);
auto dsetInfo = h5pp::scan::makeDsetInfo(openFileHandle(), data, options, plists);
h5pp::File::createDataset(dsetInfo);
return dsetInfo;
}
Expand Down Expand Up @@ -369,7 +369,7 @@ namespace h5pp {
throw std::runtime_error(h5pp::format("Attempted to write on read-only file [{}]", filePath.string()));
options.assertWellDefined();
auto dataInfo = h5pp::scan::scanDataInfo(data, options);
auto dsetInfo = h5pp::scan::inferDsetInfo(
auto dsetInfo = h5pp::scan::makeDsetInfo(
openFileHandle(), data, options, plists); // Creates if it doesn't exist, otherwise it just fills the meta data
writeDataset(data, dataInfo, dsetInfo);
return dsetInfo;
Expand Down
10 changes: 5 additions & 5 deletions h5pp/include/h5pp/details/h5ppScan.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ namespace h5pp::scan {
return info;
}

/*! \brief Populates a DsetInfo object based on passed options only
/*! \brief Populates a DsetInfo object based entirely on passed options
* @param loc A valid HDF5 location (group or file)
* @param options A struct containing optional metadata
* @param plists (optional) access property for the file. Used to determine link access property when searching for the dataset.
*/
template<typename h5x>
inline h5pp::DsetInfo inferDsetInfo(const h5x &loc, const Options &options, const PropertyLists &plists = PropertyLists()) {
inline h5pp::DsetInfo makeDsetInfo(const h5x &loc, const Options &options, const PropertyLists &plists = PropertyLists()) {
static_assert(h5pp::type::sfinae::is_h5_loc_v<h5x>,
"Template function [h5pp::scan::inferDsetInfo(const h5x & loc, ...)] requires type h5x to be: "
"Template function [h5pp::scan::makeDsetInfo(const h5x & loc, ...)] requires type h5x to be: "
"[h5pp::hid::h5f], [h5pp::hid::h5g] or [h5pp::hid::h5o]");

auto info = readDsetInfo(loc, options, plists);
Expand Down Expand Up @@ -198,10 +198,10 @@ namespace h5pp::scan {
const Options & options = Options(),
const PropertyLists &plists = PropertyLists()) {
static_assert(h5pp::type::sfinae::is_h5_loc_v<h5x>,
"Template function [h5pp::scan::inferDsetInfo(const h5x & loc, ...)] requires type h5x to be: "
"Template function [h5pp::scan::makeDsetInfo(const h5x & loc, ...)] requires type h5x to be: "
"[h5pp::hid::h5f], [h5pp::hid::h5g] or [h5pp::hid::h5o]");
static_assert(not h5pp::type::sfinae::is_h5_loc_v<DataType>,
"Template function [h5pp::scan::inferDsetInfo(...,const DataType & data, ...)] requires type DataType to be: "
"Template function [h5pp::scan::makeDsetInfo(...,const DataType & data, ...)] requires type DataType to be: "
"none of [h5pp::hid::h5f], [h5pp::hid::h5g] or [h5pp::hid::h5o]");
auto info = readDsetInfo(loc, options, plists);
if(info.dsetExists.value()) return info;
Expand Down

0 comments on commit 5934a75

Please sign in to comment.