VTK
9.2.6
Main Page
Related Pages
Topics
Namespaces
Classes
Files
File List
File Members
IO
HDF
vtkHDF5ScopedHandle.h
Go to the documentation of this file.
1
#ifndef vtkHDF5ScopedHandle_h
2
#define vtkHDF5ScopedHandle_h
3
4
namespace
vtkHDF
5
{
6
10
#define DefineScopedHandle(name) \
11
class ScopedH5##name##Handle \
12
{ \
13
public: \
14
ScopedH5##name##Handle(const ScopedH5##name##Handle& other) { this->Handle = other.Handle; } \
15
ScopedH5##name##Handle(hid_t handle) \
16
: Handle(handle) \
17
{ \
18
} \
19
virtual ~ScopedH5##name##Handle() \
20
{ \
21
if (this->Handle >= 0) \
22
{ \
23
H5##name##close(this->Handle); \
24
} \
25
} \
26
\
27
operator hid_t() const { return this->Handle; } \
28
\
29
private: \
30
hid_t Handle; \
31
};
32
33
// Defines ScopedH5AHandle closed with H5Aclose
34
DefineScopedHandle
(A);
35
36
// Defines ScopedH5DHandle closed with H5Dclose
37
DefineScopedHandle
(D);
38
39
// Defines ScopedH5FHandle closed with H5Fclose
40
DefineScopedHandle
(F);
41
42
// Defines ScopedH5GHandle closed with H5Gclose
43
DefineScopedHandle
(G);
44
45
// Defines ScopedH5SHandle closed with H5Sclose
46
DefineScopedHandle
(S);
47
48
// Defines ScopedH5THandle closed with H5Tclose
49
DefineScopedHandle
(T);
50
51
}
52
53
#endif
54
// VTK-HeaderTest-Exclude: vtkHDF5ScopedHandle.h
vtkHDF
Definition
vtkHDF5ScopedHandle.h:5
DefineScopedHandle
#define DefineScopedHandle(name)
RAII class for automatically closing H5 handles.
Definition
vtkHDF5ScopedHandle.h:10
Generated on Sat Jul 20 2024 00:00:00 for VTK by
1.11.0