13 if (
id < 0)
throw std::runtime_error(std::string(
"hdf5lib: ") + what);
18 if (err < 0)
throw std::runtime_error(std::string(
"hdf5lib: ") + what);
31 if (
id_ >= 0) H5Iinc_ref(
id_);
46 if (
id_ >= 0) H5Iinc_ref(
id_);
53 if (
this == &o)
return *
this;
56 if (
id_ >= 0) H5Iinc_ref(
id_);
62 if (
this == &o)
return *
this;
65 o.id_ = H5I_INVALID_HID;
75 id_ = H5I_INVALID_HID;
79 hid_t
get() const noexcept {
return id_; }
80 bool valid() const noexcept {
return id_ >= 0; }
85 id_ = H5I_INVALID_HID;
90 hid_t
id_ = H5I_INVALID_HID;
bool valid() const noexcept
Definition handle.hh:80
hid_t release() noexcept
Definition handle.hh:82
void reset() noexcept
Definition handle.hh:71
Handle & operator=(const Handle &o)
Definition handle.hh:51
Handle(hid_t id)
Definition handle.hh:29
hid_t get() const noexcept
Definition handle.hh:79
~Handle()
Definition handle.hh:69
static Handle take(hid_t id)
Definition handle.hh:37
Handle & operator=(Handle &&o) noexcept
Definition handle.hh:60
Handle(const Handle &o)
Definition handle.hh:44
Handle(Handle &&o) noexcept
Definition handle.hh:49
hid_t id_
Definition handle.hh:90
void throw_if_negative(hid_t id, const char *what)
Definition handle.hh:11