MaterialX 1.38.2
Exception.h
Go to the documentation of this file.
1//
2// TM & (c) 2021 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
3// All rights reserved. See LICENSE.txt for license.
4//
5
6#ifndef MATERIALX_EXCEPTION_H
7#define MATERIALX_EXCEPTION_H
8
10
11#include <exception>
12
15
16namespace MaterialX
17{
18
22class MX_CORE_API Exception : public std::exception
23{
24 public:
25 explicit Exception(const string& msg) :
26 _msg(msg)
27 {
28 }
29
30 Exception(const Exception& e) :
31 _msg(e._msg)
32 {
33 }
34
35 Exception& operator=(const Exception& e)
36 {
37 _msg = e._msg;
38 return *this;
39 }
40
41 virtual ~Exception() noexcept
42 {
43 }
44
45 const char* what() const noexcept override
46 {
47 return _msg.c_str();
48 }
49
50 private:
51 string _msg;
52};
53
54} // namespace MaterialX
55
56#endif
Import and export declarations for the Core library.
The base class for exceptions that are propagated from the MaterialX library to the client applicatio...
Definition: Exception.h:23