MaterialX  1.36.1
Library.h
Go to the documentation of this file.
1 //
2 // TM & (c) 2017 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
3 // All rights reserved. See LICENSE.txt for license.
4 //
5 
6 #ifndef MATERIALX_LIBRARY_H
7 #define MATERIALX_LIBRARY_H
8 
12 
13 #include <algorithm>
14 #include <exception>
15 #include <functional>
16 #include <memory>
17 #include <set>
18 #include <string>
19 #include <unordered_map>
20 #include <vector>
21 
22 namespace MaterialX
23 {
24 
25 using std::string;
26 using std::vector;
27 using std::shared_ptr;
28 using std::weak_ptr;
29 
31 using StringVec = vector<string>;
33 using StringMap = std::unordered_map<string, string>;
35 using StringSet = std::set<string>;
36 
40 class Exception : public std::exception
41 {
42  public:
43  explicit Exception(const string& msg) :
44  std::exception(),
45  _msg(msg)
46  {
47  }
48 
49  Exception(const Exception& e) :
50  std::exception(),
51  _msg(e._msg)
52  {
53  }
54 
55  Exception& operator=(const Exception& e)
56  {
57  _msg = e._msg;
58  return *this;
59  }
60 
61  virtual ~Exception() throw()
62  {
63  }
64 
65  const char* what() const throw() override
66  {
67  return _msg.c_str();
68  }
69 
70  private:
71  string _msg;
72 };
73 
74 } // namespace MaterialX
75 
76 #endif
Definition: Definition.cpp:10
std::unordered_map< string, string > StringMap
An unordered map with strings as both keys and values.
Definition: Library.h:33
The base class for exceptions that are propagated from the MaterialX library to the client applicatio...
Definition: Library.h:40
std::set< string > StringSet
A set of strings.
Definition: Library.h:35
vector< string > StringVec
A vector of strings.
Definition: Library.h:31