18template <
typename Derivate>
20 static_assert(std::is_same<Derivate, Group>::value || std::is_same<Derivate, DataSet>::value ||
21 std::is_same<Derivate, Attribute>::value,
22 "PathTraits can only be applied to Group, DataSet and Attribute");
23 const auto& obj =
static_cast<const Derivate&
>(*this);
27 const hid_t file_id = H5Iget_file_id(obj.getId());
31 _file_obj.reset(
new File(file_id));
34template <
typename Derivate>
36 return details::get_name([
this](
char* buffer,
size_t length) {
37 return H5Iget_name(
static_cast<const Derivate*
>(
this)->getId(), buffer, length);
41template <
typename Derivate>
File class.
Definition H5File.hpp:24
PathTraits()
Definition H5Path_traits_misc.hpp:19
File & getFile() const noexcept
Return a reference to the File object this object belongs.
Definition H5Path_traits_misc.hpp:42
std::string getPath() const
return the path to the current object
Definition H5Path_traits_misc.hpp:35
Definition H5_definitions.hpp:15
static void ToException(const std::string &prefix_msg)
Definition H5Exception_misc.hpp:42