File indexing completed on 2026-09-22 08:54:39
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include <memory>
0012 #include <stdexcept>
0013 #include <string>
0014
0015 #include <H5Ipublic.h>
0016
0017 namespace HighFive {
0018
0019
0020
0021
0022
0023 class Exception: public std::exception {
0024 public:
0025 explicit Exception(const std::string& err_msg)
0026 : _errmsg(err_msg) {}
0027
0028 Exception(const Exception& other) = default;
0029 Exception(Exception&& other) noexcept = default;
0030
0031 Exception& operator=(const Exception& other) = default;
0032 Exception& operator=(Exception&& other) noexcept = default;
0033
0034 ~Exception() noexcept override {}
0035
0036
0037
0038
0039
0040 inline const char* what() const noexcept override {
0041 return _errmsg.c_str();
0042 }
0043
0044
0045
0046
0047
0048 inline virtual void setErrorMsg(const std::string& errmsg) {
0049 _errmsg = errmsg;
0050 }
0051
0052
0053
0054
0055
0056
0057 inline Exception* nextException() const {
0058 return _next.get();
0059 }
0060
0061
0062
0063
0064
0065 inline hid_t getErrMajor() const {
0066 return _err_major;
0067 }
0068
0069
0070
0071
0072
0073 inline hid_t getErrMinor() const {
0074 return _err_minor;
0075 }
0076
0077 private:
0078 std::string _errmsg;
0079 std::shared_ptr<Exception> _next = nullptr;
0080 hid_t _err_major = 0, _err_minor = 0;
0081
0082 friend struct HDF5ErrMapper;
0083 };
0084
0085
0086
0087
0088 class ObjectException: public Exception {
0089 public:
0090 explicit ObjectException(const std::string& err_msg)
0091 : Exception(err_msg) {}
0092 };
0093
0094
0095
0096
0097 class DataTypeException: public Exception {
0098 public:
0099 explicit DataTypeException(const std::string& err_msg)
0100 : Exception(err_msg) {}
0101 };
0102
0103
0104
0105
0106 class FileException: public Exception {
0107 public:
0108 explicit FileException(const std::string& err_msg)
0109 : Exception(err_msg) {}
0110 };
0111
0112
0113
0114
0115 class DataSpaceException: public Exception {
0116 public:
0117 explicit DataSpaceException(const std::string& err_msg)
0118 : Exception(err_msg) {}
0119 };
0120
0121
0122
0123
0124 class AttributeException: public Exception {
0125 public:
0126 explicit AttributeException(const std::string& err_msg)
0127 : Exception(err_msg) {}
0128 };
0129
0130
0131
0132
0133 class DataSetException: public Exception {
0134 public:
0135 explicit DataSetException(const std::string& err_msg)
0136 : Exception(err_msg) {}
0137 };
0138
0139
0140
0141
0142 class GroupException: public Exception {
0143 public:
0144 explicit GroupException(const std::string& err_msg)
0145 : Exception(err_msg) {}
0146 };
0147
0148
0149
0150
0151 class PropertyException: public Exception {
0152 public:
0153 explicit PropertyException(const std::string& err_msg)
0154 : Exception(err_msg) {}
0155 };
0156
0157
0158
0159
0160 class ReferenceException: public Exception {
0161 public:
0162 explicit ReferenceException(const std::string& err_msg)
0163 : Exception(err_msg) {}
0164 };
0165 }
0166
0167 #include "bits/H5Exception_misc.hpp"