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
HighFive::PropertyException::PropertyException
PropertyException(const std::string &err_msg)
Definition: H5Exception.hpp:132
HighFive::PropertyException
Exception specific to HighFive Property interface.
Definition: H5Exception.hpp:130
HighFive::Exception::getErrMajor
hid_t getErrMajor() const
HDF5 library error mapper.
Definition: H5Exception.hpp:55
HighFive::DataSpaceException::DataSpaceException
DataSpaceException(const std::string &err_msg)
Definition: H5Exception.hpp:100
HighFive::GroupException
Exception specific to HighFive Group interface.
Definition: H5Exception.hpp:122
HighFive::Exception::nextException
Exception * nextException() const
nextException
Definition: H5Exception.hpp:49
HighFive::GroupException::GroupException
GroupException(const std::string &err_msg)
Definition: H5Exception.hpp:124
HighFive::FileException::FileException
FileException(const std::string &err_msg)
Definition: H5Exception.hpp:92
HighFive::Exception::setErrorMsg
virtual void setErrorMsg(const std::string &errmsg)
define the error message
Definition: H5Exception.hpp:40
HighFive::Exception::Exception
Exception(const std::string &err_msg)
Definition: H5Exception.hpp:25
HighFive::ObjectException::ObjectException
ObjectException(const std::string &err_msg)
Definition: H5Exception.hpp:76
HighFive::AttributeException
Exception specific to HighFive Attribute interface.
Definition: H5Exception.hpp:106
HighFive::AttributeException::AttributeException
AttributeException(const std::string &err_msg)
Definition: H5Exception.hpp:108
HighFive::DataSetException
Exception specific to HighFive DataSet interface.
Definition: H5Exception.hpp:114
HighFive::FileException
Exception specific to HighFive File interface.
Definition: H5Exception.hpp:90
HighFive::DataTypeException::DataTypeException
DataTypeException(const std::string &err_msg)
Definition: H5Exception.hpp:84
HighFive::Exception::_err_major
hid_t _err_major
Definition: H5Exception.hpp:66
HighFive::ObjectException
Exception specific to HighFive Object interface.
Definition: H5Exception.hpp:74
H5Exception_misc.hpp
HighFive::DataSetException::DataSetException
DataSetException(const std::string &err_msg)
Definition: H5Exception.hpp:116
HighFive::Exception::what
const char * what() const override
get the current exception error message
Definition: H5Exception.hpp:34
HighFive::Exception
Basic HighFive Exception class.
Definition: H5Exception.hpp:23
HighFive::Exception::~Exception
virtual ~Exception()
Definition: H5Exception.hpp:28
HighFive::Exception::_next
details::Mem::shared_ptr< Exception > _next
Definition: H5Exception.hpp:65
HighFive::Exception::getErrMinor
hid_t getErrMinor() const
HDF5 library error mapper.
Definition: H5Exception.hpp:61
H5Utils.hpp
HighFive::HDF5ErrMapper
Definition: H5Exception_misc.hpp:19
HighFive::DataTypeException
Exception specific to HighFive DataType interface.
Definition: H5Exception.hpp:82
HighFive
Definition: H5Annotate_traits.hpp:14
HighFive::Exception::_err_minor
hid_t _err_minor
Definition: H5Exception.hpp:66
HighFive::Exception::_errmsg
std::string _errmsg
Definition: H5Exception.hpp:64
HighFive::DataSpaceException
Exception specific to HighFive DataSpace interface.
Definition: H5Exception.hpp:98


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 Wed Mar 2 2022 00:37:23