h5gt 0.2.0
C++ wrapper for HDF5 library (based on HighFive project)
Loading...
Searching...
No Matches
H5Utility.hpp
1/*
2 * Copyright (c), 2017, Blue Brain Project - 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
10#ifndef H5UTILITY_HPP
11#define H5UTILITY_HPP
12
13#include <H5Epublic.h>
14
15namespace h5gt {
16
21public:
22 inline SilenceHDF5(bool enable=true)
23 : _client_data(nullptr)
24 {
25 H5Eget_auto2(H5E_DEFAULT, &_func, &_client_data);
26 if (enable) H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
27 }
28
29 inline ~SilenceHDF5() {
30 H5Eset_auto2(H5E_DEFAULT, _func, _client_data);
31 }
32
33private:
34 H5E_auto2_t _func;
35 void* _client_data;
36};
37
38} // namespace h5gt
39
40#endif // H5UTIL_HPP
Utility class to disable HDF5 stack printing inside a scope.
Definition H5Utility.hpp:20