HighFive 2.10.1
HighFive - Header-only C++ HDF5 interface
Loading...
Searching...
No Matches
H5Group.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c), 2017, Adrien Devresse <adrien.devresse@epfl.ch>
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#pragma once
10
11#include <H5Gpublic.h>
12
13#include "H5Object.hpp"
14#include "bits/H5Friends.hpp"
19
20namespace HighFive {
21
22namespace detail {
38Group make_group(hid_t);
39} // namespace detail
40
43class Group: public Object,
44 public NodeTraits<Group>,
45 public AnnotateTraits<Group>,
46 public PathTraits<Group> {
47 public:
49
51 H5_DEPRECATED("Default constructor creates unsafe uninitialized objects")
52 Group() = default;
53
54 std::pair<unsigned int, unsigned int> getEstimatedLinkInfo() const;
55
58 return details::get_plist<GroupCreateProps>(*this, H5Gget_create_plist);
59 }
60
61 Group(Object&& o) noexcept
62 : Object(std::move(o)){};
63
64 protected:
65 using Object::Object;
66
67 friend Group detail::make_group(hid_t);
68 friend class File;
69 friend class Reference;
70#if HIGHFIVE_HAS_FRIEND_DECLARATIONS
71 template <typename Derivate>
72 friend class ::HighFive::NodeTraits;
73#endif
74};
75
76inline std::pair<unsigned int, unsigned int> Group::getEstimatedLinkInfo() const {
77 auto gcpl = getCreatePropertyList();
78 auto eli = EstimatedLinkInfo(gcpl);
79 return std::make_pair(eli.getEntries(), eli.getNameLength());
80}
81
82namespace detail {
83inline Group make_group(hid_t hid) {
84 return Group(hid);
85}
86} // namespace detail
87
88} // namespace HighFive
#define H5_DEPRECATED(msg)
Definition H5_definitions.hpp:9
Definition H5Annotate_traits.hpp:18
File class.
Definition H5File.hpp:24
Represents an hdf5 group.
Definition H5Group.hpp:46
Object()
Definition H5Object_misc.hpp:25
static const ObjectType type
Definition H5Group.hpp:48
GroupCreateProps getCreatePropertyList() const
Get the list of properties for creation of this group.
Definition H5Group.hpp:57
Group(Object &&o) noexcept
Definition H5Group.hpp:61
std::pair< unsigned int, unsigned int > getEstimatedLinkInfo() const
Definition H5Group.hpp:76
NodeTraits: Base class for Group and File.
Definition H5Node_traits.hpp:28
Definition H5Object.hpp:54
Object()
Definition H5Object_misc.hpp:25
Definition H5Path_traits.hpp:16
HDF5 property Lists.
Definition H5PropertyList.hpp:160
An HDF5 (object) reference type.
Definition H5Reference.hpp:33
Definition H5_definitions.hpp:22
ObjectType
Enum of the types of objects (H5O api)
Definition H5Object.hpp:24