HighFive 2.9.0
HighFive - Header-only C++ HDF5 interface
Loading...
Searching...
No Matches
H5Reference.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c), 2020, EPFL - Blue Brain Project
3 *
4 * Distributed under the Boost Software License, Version 1.0.
5 * (See accompanying file LICENSE_1_0.txt or copy at
6 * http://www.boost.org/LICENSE_1_0.txt)
7 *
8 */
9
10#pragma once
11
12#include <string>
13#include <vector>
14
15#include <H5Ipublic.h>
16#include <H5Rpublic.h>
17
19
20namespace HighFive {
21
22namespace details {
23template <typename T>
24struct inspector;
25}
33class Reference {
34 public:
36 Reference() = default;
37
42 Reference(const Object& location, const Object& object);
43
49 template <typename T>
50 T dereference(const Object& location) const;
51
56 ObjectType getType(const Object& location) const;
57
58 protected:
60 inline explicit Reference(const hobj_ref_t h5_ref)
61 : href(h5_ref){};
62
67 void create_ref(hobj_ref_t* refptr) const;
68
69 private:
70 Object get_ref(const Object& location) const;
71
72 hobj_ref_t href{};
73 std::string obj_name{};
74 hid_t parent_id{};
75
76 friend struct details::inspector<Reference>;
77};
78
79} // namespace HighFive
80
Definition H5Object.hpp:54
An HDF5 (object) reference type.
Definition H5Reference.hpp:33
T dereference(const Object &location) const
Retrieve the Object being referenced by the Reference.
Definition H5Reference_misc.hpp:39
Reference(const hobj_ref_t h5_ref)
Create a Reference from a low-level HDF5 object reference.
Definition H5Reference.hpp:60
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