6 #ifndef ECHELON_HDF5_PRECURSOR_ERROR_HANDLING_HPP 7 #define ECHELON_HDF5_PRECURSOR_ERROR_HANDLING_HPP 11 #include <system_error> 14 #include <boost/assert.hpp> 16 #define ECHELON_ASSERT_MSG(expr, msg) BOOST_ASSERT_MSG(expr, msg) 20 #define ECHELON_VERIFY_MSG(expr, msg) ((void)(expr)) 24 #define ECHELON_VERIFY_MSG(expr, msg) ECHELON_ASSERT_MSG(expr, msg) 35 class hdf5_category :
public std::error_category
38 virtual ~hdf5_category() =
default;
40 const char* name() const noexcept override;
42 std::
string message(
int condition) const override;
45 const std::error_category& get_hdf5_category();
47 class exception : public std::system_error
50 explicit exception(
int ev_);
52 explicit exception(
int ev_, std::string what_);
54 virtual ~exception() noexcept = default;
57 class hdf5_error : public exception
60 hdf5_error(hid_t major_num_, hid_t minor_num_);
62 hdf5_error(hid_t major_num_, hid_t minor_num_, std::string what_);
64 virtual ~hdf5_error() noexcept = default;
66 hid_t minor_num() const;
75 explicit error_class(hid_t id_);
79 error_class(
const error_class&) =
delete;
80 error_class(error_class&&) =
default;
82 error_class& operator=(
const error_class&) =
delete;
83 error_class& operator=(error_class&&) =
default;
94 explicit error_message(hid_t id_);
96 error_message(
const error_message&) =
delete;
97 error_message(error_message&&) =
default;
99 error_message& operator=(
const error_message&) =
delete;
100 error_message& operator=(error_message&&) =
default;
110 const error_class& get_echelon_error_class();
112 const error_message& get_unable_to_obtain_ref_msg();
113 const error_message& get_no_associated_name_msg();
115 void push_error_onto_stack(
const char* file,
const char* func,
unsigned line,
116 const error_class& err_class,
const error_message& major_msg,
117 const error_message& minor_msg,
const std::string& desc);
119 void throw_on_hdf5_error();
121 void enable_error_handling();
echelon's core namespace
Definition: attribute.cpp:10