hops
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 #ifndef H5REFERENCE_HPP
11 #define H5REFERENCE_HPP
12 
13 #include <string>
14 #include <vector>
15 
16 #include <H5Ipublic.h>
17 #include <H5Rpublic.h>
18 
19 #include "H5Object.hpp"
20 #include "bits/H5_definitions.hpp"
21 
22 namespace HighFive {
23 
31 class Reference {
32  public:
34  Reference() = default;
35 
40  Reference(const Object& location, const Object& object);
41 
47  template <typename T>
48  T dereference(const Object& location) const;
49 
54  ObjectType getType(const Object& location) const;
55 
56  protected:
58  inline explicit Reference(const hobj_ref_t h5_ref)
59  : href(h5_ref) {};
60 
65  void create_ref(hobj_ref_t* refptr) const;
66 
67  private:
68 
69  Object get_ref(const Object& location) const;
70 
71  hobj_ref_t href{};
72  std::string obj_name{};
73  hid_t parent_id{};
74 
75  friend details::data_converter<std::vector<Reference>>;
76 };
77 
78 } // namespace HighFive
79 
81 
82 #endif // H5REFERENCE_HPP
HighFive::Reference
An HDF5 (object) reference type.
Definition: H5Reference.hpp:31
HighFive::Reference::dereference
T dereference(const Object &location) const
Retrieve the Object being referenced by the Reference.
Definition: H5Reference_misc.hpp:38
H5Object.hpp
HighFive::Reference::Reference
Reference(const hobj_ref_t h5_ref)
Create a Reference from a low-level HDF5 object reference.
Definition: H5Reference.hpp:58
HighFive::Reference::create_ref
void create_ref(hobj_ref_t *refptr) const
Create the low-level reference and store it at refptr.
Definition: H5Reference_misc.hpp:26
HighFive::Reference::Reference
Reference()=default
Create an empty Reference to be initialized later.
H5Reference_misc.hpp
HighFive::Object
Definition: H5Object.hpp:36
HighFive::ObjectType
ObjectType
Enum of the types of objects (H5O api)
Definition: H5Object.hpp:25
string
NAME string(REPLACE ".cpp" "_bin" example_name ${example_filename}) if($
Definition: hops/Third-party/HighFive/src/examples/CMakeLists.txt:6
HighFive::Reference::getType
ObjectType getType(const Object &location) const
Get only the type of the referenced Object.
Definition: H5Reference_misc.hpp:33
HighFive
Definition: H5_definitions.hpp:15
H5_definitions.hpp