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 #ifndef H5EXCEPTION_HPP
10 #define H5EXCEPTION_HPP
11 
12 #include <stdexcept>
13 #include <string>
14 
15 #include "bits/H5Utils.hpp"
16 
17 namespace HighFive {
18 
23 class Exception : public std::exception {
24  public:
25  Exception(const std::string& err_msg)
26  : _errmsg(err_msg), _next(), _err_major(0), _err_minor(0) {}
27 
28  virtual ~Exception() throw() {}
29 
34  inline const char* what() const throw() override { return _errmsg.c_str(); }
35 
40  inline virtual void setErrorMsg(const std::string& errmsg) {
41  _errmsg = errmsg;
42  }
43 
49  inline Exception* nextException() const { return _next.get(); }
50 
55  inline hid_t getErrMajor() const { return _err_major; }
56 
61  inline hid_t getErrMinor() const { return _err_minor; }
62 
63  protected:
64  std::string _errmsg;
65  details::Mem::shared_ptr<Exception> _next;
67 
68  friend struct HDF5ErrMapper;
69 };
70 
74 class ObjectException : public Exception {
75  public:
76  ObjectException(const std::string& err_msg) : Exception(err_msg) {}
77 };
78 
82 class DataTypeException : public Exception {
83  public:
84  DataTypeException(const std::string& err_msg) : Exception(err_msg) {}
85 };
86 
90 class FileException : public Exception {
91  public:
92  FileException(const std::string& err_msg) : Exception(err_msg) {}
93 };
94 
98 class DataSpaceException : public Exception {
99  public:
100  DataSpaceException(const std::string& err_msg) : Exception(err_msg) {}
101 };
102 
107  public:
108  AttributeException(const std::string& err_msg) : Exception(err_msg) {}
109 };
110 
114 class DataSetException : public Exception {
115  public:
116  DataSetException(const std::string& err_msg) : Exception(err_msg) {}
117 };
118 
122 class GroupException : public Exception {
123  public:
124  GroupException(const std::string& err_msg) : Exception(err_msg) {}
125 };
126 
130 class PropertyException : public Exception {
131  public:
132  PropertyException(const std::string& err_msg) : Exception(err_msg) {}
133 };
134 }
135 
136 #include "bits/H5Exception_misc.hpp"
137 
138 #endif // H5EXCEPTION_HPP
AttributeException(const std::string &err_msg)
GroupException(const std::string &err_msg)
Exception specific to HighFive DataSet interface.
Exception specific to HighFive DataSpace interface.
Definition: H5Exception.hpp:98
PropertyException(const std::string &err_msg)
Exception specific to HighFive Attribute interface.
Exception(const std::string &err_msg)
Definition: H5Exception.hpp:25
std::string _errmsg
Definition: H5Exception.hpp:64
Exception * nextException() const
nextException
Definition: H5Exception.hpp:49
DataSetException(const std::string &err_msg)
virtual void setErrorMsg(const std::string &errmsg)
define the error message
Definition: H5Exception.hpp:40
Exception specific to HighFive File interface.
Definition: H5Exception.hpp:90
FileException(const std::string &err_msg)
Definition: H5Exception.hpp:92
hid_t getErrMinor() const
HDF5 library error mapper.
Definition: H5Exception.hpp:61
Exception specific to HighFive DataType interface.
Definition: H5Exception.hpp:82
Exception specific to HighFive Property interface.
DataSpaceException(const std::string &err_msg)
const char * what() const override
get the current exception error message
Definition: H5Exception.hpp:34
DataTypeException(const std::string &err_msg)
Definition: H5Exception.hpp:84
Exception specific to HighFive Object interface.
Definition: H5Exception.hpp:74
Exception specific to HighFive Group interface.
Basic HighFive Exception class.
Definition: H5Exception.hpp:23
hid_t getErrMajor() const
HDF5 library error mapper.
Definition: H5Exception.hpp:55
ObjectException(const std::string &err_msg)
Definition: H5Exception.hpp:76
details::Mem::shared_ptr< Exception > _next
Definition: H5Exception.hpp:65


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:06