24 : parent_id(location.getId()) {
25 obj_name = details::get_name([&](
char* buffer,
size_t length) {
26 return detail::h5i_get_name(
object.getId(), buffer, length);
31 detail::h5r_create(refptr, parent_id, obj_name.c_str(), H5R_OBJECT, -1);
35 return get_ref(location).
getType();
40 static_assert(std::is_same<DataSet, T>::value || std::is_same<Group, T>::value,
41 "We can only (de)reference HighFive::Group or HighFive:DataSet");
42 auto obj = get_ref(location);
43 if (obj.getType() != T::type) {
46#if defined __GNUC__ && __GNUC__ < 9
47 return std::move(obj);
53inline Object Reference::get_ref(
const Object& location)
const {
54#if (H5Rdereference_vers == 2)
55 hid_t res = detail::h5r_dereference(location.
getId(), H5P_DEFAULT, H5R_OBJECT, &href);
57 hid_t res = detail::h5r_dereference(location.
getId(), H5R_OBJECT, &href);
Definition H5Object.hpp:54
hid_t getId() const noexcept
getId
Definition H5Object_misc.hpp:69
ObjectType getType() const
Gets the fundamental type of the object (dataset, group, etc)
Definition H5Object_misc.hpp:92
T dereference(const Object &location) const
Retrieve the Object being referenced by the Reference.
Definition H5Reference_misc.hpp:39
Reference()=default
Create an empty Reference to be initialized later.
ObjectType getType(const Object &location) const
Get only the type of the referenced Object.
Definition H5Reference_misc.hpp:34
void create_ref(hobj_ref_t *refptr) const
Create the low-level reference and store it at refptr.
Definition H5Reference_misc.hpp:30
Definition H5_definitions.hpp:22
ObjectType
Enum of the types of objects (H5O api)
Definition H5Object.hpp:24
static void ToException(const std::string &prefix_msg)
Definition H5Exception_misc.hpp:43