Skip to content

Commit

Permalink
Rename h5pp::scan::getDsetInfo --> h5pp::scan::inferDsetInfo 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 742ee41 commit eee3dc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 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::getDsetInfo(openFileHandle(), options, plists);
auto dsetInfo = h5pp::scan::inferDsetInfo(openFileHandle(), options, plists);
h5pp::File::createDataset(dsetInfo);
return dsetInfo;
}
Expand Down
11 changes: 8 additions & 3 deletions h5pp/include/h5pp/details/h5ppScan.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,19 @@ namespace h5pp::scan {
return info;
}

/*! \fn getDsetInfo
* Infers information for a new dataset based and passed options only
/*! \fn inferDsetInfo
* Infers information for a new dataset based on passed options only
* @param loc A valid HDF5 location (group or file)
* @param dsetPath The path to the dataset relative to loc
* @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 getDsetInfo(const h5x &loc, const Options &options, const PropertyLists &plists = PropertyLists()) {
inline h5pp::DsetInfo inferDsetInfo(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: "
"[h5pp::hid::h5f], [h5pp::hid::h5g] or [h5pp::hid::h5o]");


auto info = readDsetInfo(loc, options, plists);
if(info.dsetExists.value()) return info;
h5pp::logger::log->debug("Creating metadata for new dataset [{}]", options.linkPath.value());
Expand Down

0 comments on commit eee3dc5

Please sign in to comment.