File indexing completed on 2025-04-19 08:55:36
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 Exception(const std::string& err_msg)
0026 : _errmsg(err_msg)
0027 , _next()
0028 , _err_major(0)
0029 , _err_minor(0) {}
0030
0031 virtual ~Exception() throw() {}
0032
0033
0034
0035
0036
0037 inline const char* what() const throw() override {
0038 return _errmsg.c_str();
0039 }
0040
0041
0042
0043
0044
0045 inline virtual void setErrorMsg(const std::string& errmsg) {
0046 _errmsg = errmsg;
0047 }
0048
0049
0050
0051
0052
0053
0054 inline Exception* nextException() const {
0055 return _next.get();
0056 }
0057
0058
0059
0060
0061
0062 inline hid_t getErrMajor() const {
0063 return _err_major;
0064 }
0065
0066
0067
0068
0069
0070 inline hid_t getErrMinor() const {
0071 return _err_minor;
0072 }
0073
0074 protected:
0075 std::string _errmsg;
0076 std::shared_ptr<Exception> _next;
0077 hid_t _err_major, _err_minor;
0078
0079 friend struct HDF5ErrMapper;
0080 };
0081
0082
0083
0084
0085 class ObjectException: public Exception {
0086 public:
0087 ObjectException(const std::string& err_msg)
0088 : Exception(err_msg) {}
0089 };
0090
0091
0092
0093
0094 class DataTypeException: public Exception {
0095 public:
0096 DataTypeException(const std::string& err_msg)
0097 : Exception(err_msg) {}
0098 };
0099
0100
0101
0102
0103 class FileException: public Exception {
0104 public:
0105 FileException(const std::string& err_msg)
0106 : Exception(err_msg) {}
0107 };
0108
0109
0110
0111
0112 class DataSpaceException: public Exception {
0113 public:
0114 DataSpaceException(const std::string& err_msg)
0115 : Exception(err_msg) {}
0116 };
0117
0118
0119
0120
0121 class AttributeException: public Exception {
0122 public:
0123 AttributeException(const std::string& err_msg)
0124 : Exception(err_msg) {}
0125 };
0126
0127
0128
0129
0130 class DataSetException: public Exception {
0131 public:
0132 DataSetException(const std::string& err_msg)
0133 : Exception(err_msg) {}
0134 };
0135
0136
0137
0138
0139 class GroupException: public Exception {
0140 public:
0141 GroupException(const std::string& err_msg)
0142 : Exception(err_msg) {}
0143 };
0144
0145
0146
0147
0148 class PropertyException: public Exception {
0149 public:
0150 PropertyException(const std::string& err_msg)
0151 : Exception(err_msg) {}
0152 };
0153
0154
0155
0156
0157 class ReferenceException: public Exception {
0158 public:
0159 ReferenceException(const std::string& err_msg)
0160 : Exception(err_msg) {}
0161 };
0162 }
0163
0164 #include "bits/H5Exception_misc.hpp"