XT-Audio
XtException.hpp
Go to the documentation of this file.
1 #ifndef XT_API_EXCEPTION_HPP
2 #define XT_API_EXCEPTION_HPP
3 
6 #include <stdexcept>
9 namespace Xt {
10 
11 class Exception final:
12 public std::exception
13 {
14  uint64_t const _error;
15 public:
16  char const* what() const noexcept override;
17  Exception(uint64_t error): _error(error) { }
18  uint64_t GetError() const { return _error; }
19 };
20 
21 inline char const*
22 Exception::what() const noexcept
23 {
24  Detail::XtErrorInfo coreInfo = Detail::XtAudioGetErrorInfo(_error);
25  return Detail::XtPrintErrorInfo(&coreInfo);
26 }
27 
28 } // namespace Xt
29 #endif // XT_API_EXCEPTION_HPP
char const * what() const noexcept override
Definition: XtException.hpp:22
uint64_t GetError() const
Definition: XtException.hpp:18
Definition: XtException.hpp:11
Definition: Callbacks.hpp:10
Exception(uint64_t error)
Definition: XtException.hpp:17