 |
VTK
9.7.0
|
Go to the documentation of this file.
3#ifndef vtkHDF5ScopedHandle_h
4#define vtkHDF5ScopedHandle_h
6#include "vtkABINamespace.h"
13VTK_ABI_NAMESPACE_BEGIN
18#define DefineScopedHandle(name) \
19 class ScopedH5##name##Handle \
22 ScopedH5##name##Handle() \
23 : Handle(H5I_INVALID_HID) \
26 ScopedH5##name##Handle(ScopedH5##name##Handle&& other) noexcept \
28 this->Handle = other.Handle; \
29 other.Handle = H5I_INVALID_HID; \
31 ScopedH5##name##Handle& operator=(ScopedH5##name##Handle&& other) noexcept \
33 std::swap(this->Handle, other.Handle); \
36 ScopedH5##name##Handle(const ScopedH5##name##Handle& other) = delete; \
37 ScopedH5##name##Handle& operator=(const ScopedH5##name##Handle&) = delete; \
38 ScopedH5##name##Handle(hid_t handle) \
42 virtual ~ScopedH5##name##Handle() \
44 if (this->Handle >= 0) \
46 H5##name##close(this->Handle); \
50 operator hid_t() const \
52 return this->Handle; \