h5gt 0.2.0
C++ wrapper for HDF5 library (based on HighFive project)
Loading...
Searching...
No Matches
H5Exception.hpp
1/*
2 * Copyright (c), 2017, Adrien Devresse <adrien.devresse@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#ifndef H5EXCEPTION_HPP
10#define H5EXCEPTION_HPP
11
12#include <memory>
13#include <stdexcept>
14#include <string>
15
16#include <H5Ipublic.h>
17
18namespace h5gt {
19
24class Exception : public std::exception {
25public:
26 Exception(const std::string& err_msg)
27 : _errmsg(err_msg), _next(), _err_major(0), _err_minor(0) {}
28
29 virtual ~Exception() throw() {}
30
35 inline const char* what() const throw() override { return _errmsg.c_str(); }
36
41 inline virtual void setErrorMsg(const std::string& errmsg) {
42 _errmsg = errmsg;
43 }
44
50 inline Exception* nextException() const { return _next.get(); }
51
56 inline hid_t getErrMajor() const { return _err_major; }
57
62 inline hid_t getErrMinor() const { return _err_minor; }
63
64protected:
65 std::string _errmsg;
66 std::shared_ptr<Exception> _next;
67 hid_t _err_major, _err_minor;
68
69 friend struct HDF5ErrMapper;
70};
71
75class ObjectException : public Exception {
76public:
77 ObjectException(const std::string& err_msg) : Exception(err_msg) {}
78};
79
84public:
85 DataTypeException(const std::string& err_msg) : Exception(err_msg) {}
86};
87
91class FileException : public Exception {
92public:
93 FileException(const std::string& err_msg) : Exception(err_msg) {}
94};
95
100public:
101 DataSpaceException(const std::string& err_msg) : Exception(err_msg) {}
102};
103
108public:
109 AttributeException(const std::string& err_msg) : Exception(err_msg) {}
110};
111
116public:
117 DataSetException(const std::string& err_msg) : Exception(err_msg) {}
118};
119
123class GroupException : public Exception {
124public:
125 GroupException(const std::string& err_msg) : Exception(err_msg) {}
126};
127
132public:
133 PropertyException(const std::string& err_msg) : Exception(err_msg) {}
134};
135
140public:
141 ReferenceException(const std::string& err_msg) : Exception(err_msg) {}
142};
143}
144
145#include "bits/H5Exception_misc.hpp"
146
147#endif // H5EXCEPTION_HPP
Exception specific to h5gt Attribute interface.
Definition H5Exception.hpp:107
Exception specific to h5gt DataSet interface.
Definition H5Exception.hpp:115
Exception specific to h5gt DataSpace interface.
Definition H5Exception.hpp:99
Exception specific to h5gt DataType interface.
Definition H5Exception.hpp:83
Basic h5gt Exception class.
Definition H5Exception.hpp:24
Exception * nextException() const
nextException
Definition H5Exception.hpp:50
const char * what() const override
get the current exception error message
Definition H5Exception.hpp:35
hid_t getErrMinor() const
HDF5 library error mapper.
Definition H5Exception.hpp:62
virtual void setErrorMsg(const std::string &errmsg)
define the error message
Definition H5Exception.hpp:41
hid_t getErrMajor() const
HDF5 library error mapper.
Definition H5Exception.hpp:56
Exception specific to h5gt File interface.
Definition H5Exception.hpp:91
Exception specific to h5gt Group interface.
Definition H5Exception.hpp:123
Exception specific to h5gt Object interface.
Definition H5Exception.hpp:75
Exception specific to h5gt Property interface.
Definition H5Exception.hpp:131
Exception specific to h5gt Reference interface.
Definition H5Exception.hpp:139
Definition H5Exception_misc.hpp:19