HighFive 2.9.0
HighFive - Header-only C++ HDF5 interface
Loading...
Searching...
No Matches
H5Exception.hpp
Go to the documentation of this file.
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#pragma once
10
11#include <memory>
12#include <stdexcept>
13#include <string>
14
15#include <H5Ipublic.h>
16
17namespace HighFive {
18
23class Exception: public std::exception {
24 public:
25 Exception(const std::string& err_msg)
26 : _errmsg(err_msg)
27 , _next()
28 , _err_major(0)
29 , _err_minor(0) {}
30
31 virtual ~Exception() throw() {}
32
37 inline const char* what() const throw() override {
38 return _errmsg.c_str();
39 }
40
45 inline virtual void setErrorMsg(const std::string& errmsg) {
46 _errmsg = errmsg;
47 }
48
54 inline Exception* nextException() const {
55 return _next.get();
56 }
57
62 inline hid_t getErrMajor() const {
63 return _err_major;
64 }
65
70 inline hid_t getErrMinor() const {
71 return _err_minor;
72 }
73
74 protected:
75 std::string _errmsg;
76 std::shared_ptr<Exception> _next;
78
79 friend struct HDF5ErrMapper;
80};
81
86 public:
87 ObjectException(const std::string& err_msg)
88 : Exception(err_msg) {}
89};
90
95 public:
96 DataTypeException(const std::string& err_msg)
97 : Exception(err_msg) {}
98};
99
104 public:
105 FileException(const std::string& err_msg)
106 : Exception(err_msg) {}
107};
108
113 public:
114 DataSpaceException(const std::string& err_msg)
115 : Exception(err_msg) {}
116};
117
122 public:
123 AttributeException(const std::string& err_msg)
124 : Exception(err_msg) {}
125};
126
131 public:
132 DataSetException(const std::string& err_msg)
133 : Exception(err_msg) {}
134};
135
140 public:
141 GroupException(const std::string& err_msg)
142 : Exception(err_msg) {}
143};
144
149 public:
150 PropertyException(const std::string& err_msg)
151 : Exception(err_msg) {}
152};
153
158 public:
159 ReferenceException(const std::string& err_msg)
160 : Exception(err_msg) {}
161};
162} // namespace HighFive
163
Exception specific to HighFive Attribute interface.
Definition H5Exception.hpp:121
AttributeException(const std::string &err_msg)
Definition H5Exception.hpp:123
Exception specific to HighFive DataSet interface.
Definition H5Exception.hpp:130
DataSetException(const std::string &err_msg)
Definition H5Exception.hpp:132
Exception specific to HighFive DataSpace interface.
Definition H5Exception.hpp:112
DataSpaceException(const std::string &err_msg)
Definition H5Exception.hpp:114
Exception specific to HighFive DataType interface.
Definition H5Exception.hpp:94
DataTypeException(const std::string &err_msg)
Definition H5Exception.hpp:96
Basic HighFive Exception class.
Definition H5Exception.hpp:23
Exception * nextException() const
nextException
Definition H5Exception.hpp:54
std::shared_ptr< Exception > _next
Definition H5Exception.hpp:76
virtual ~Exception()
Definition H5Exception.hpp:31
virtual void setErrorMsg(const std::string &errmsg)
define the error message
Definition H5Exception.hpp:45
hid_t _err_major
Definition H5Exception.hpp:77
hid_t getErrMajor() const
HDF5 library error mapper.
Definition H5Exception.hpp:62
std::string _errmsg
Definition H5Exception.hpp:75
const char * what() const override
get the current exception error message
Definition H5Exception.hpp:37
hid_t getErrMinor() const
HDF5 library error mapper.
Definition H5Exception.hpp:70
hid_t _err_minor
Definition H5Exception.hpp:77
Exception(const std::string &err_msg)
Definition H5Exception.hpp:25
Exception specific to HighFive File interface.
Definition H5Exception.hpp:103
FileException(const std::string &err_msg)
Definition H5Exception.hpp:105
Exception specific to HighFive Group interface.
Definition H5Exception.hpp:139
GroupException(const std::string &err_msg)
Definition H5Exception.hpp:141
Exception specific to HighFive Object interface.
Definition H5Exception.hpp:85
ObjectException(const std::string &err_msg)
Definition H5Exception.hpp:87
Exception specific to HighFive Property interface.
Definition H5Exception.hpp:148
PropertyException(const std::string &err_msg)
Definition H5Exception.hpp:150
Exception specific to HighFive Reference interface.
Definition H5Exception.hpp:157
ReferenceException(const std::string &err_msg)
Definition H5Exception.hpp:159
Definition H5_definitions.hpp:22
Definition H5Exception_misc.hpp:19