MaterialX 1.39.1
Loading...
Searching...
No Matches
Exception.h
Go to the documentation of this file.
1//
2// Copyright Contributors to the MaterialX Project
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#ifndef MATERIALX_EXCEPTION_H
7#define MATERIALX_EXCEPTION_H
8
10
11#include <exception>
12
15
16MATERIALX_NAMESPACE_BEGIN
17
21class MX_CORE_API Exception : public std::exception
22{
23 public:
24 explicit Exception(const string& msg) :
25 _msg(msg)
26 {
27 }
28
29 Exception(const Exception& e) :
30 _msg(e._msg)
31 {
32 }
33
34 Exception& operator=(const Exception& e)
35 {
36 _msg = e._msg;
37 return *this;
38 }
39
40 virtual ~Exception() noexcept
41 {
42 }
43
44 const char* what() const noexcept override
45 {
46 return _msg.c_str();
47 }
48
49 private:
50 string _msg;
51};
52
53MATERIALX_NAMESPACE_END
54
55#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:22