forked from autodesk-forks/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLibrary.h
77 lines (63 loc) · 1.49 KB
/
Library.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//
// TM & (c) 2017 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
// All rights reserved. See LICENSE.txt for license.
//
#ifndef MATERIALX_LIBRARY_H
#define MATERIALX_LIBRARY_H
/// @file
/// Library-wide includes and types. This file should be the first include for
/// any public header in the MaterialX library.
#include <algorithm>
#include <cstdlib>
#include <exception>
#include <functional>
#include <memory>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
namespace MaterialX
{
using std::string;
using std::vector;
using std::shared_ptr;
using std::weak_ptr;
/// A vector of strings.
using StringVec = vector<string>;
/// An unordered map with strings as both keys and values.
using StringMap = std::unordered_map<string, string>;
/// A set of strings.
using StringSet = std::set<string>;
/// @class Exception
/// The base class for exceptions that are propagated from the MaterialX library
/// to the client application.
class Exception : public std::exception
{
public:
explicit Exception(const string& msg) :
std::exception(),
_msg(msg)
{
}
Exception(const Exception& e) :
std::exception(),
_msg(e._msg)
{
}
Exception& operator=(const Exception& e)
{
_msg = e._msg;
return *this;
}
virtual ~Exception() throw()
{
}
const char* what() const throw() override
{
return _msg.c_str();
}
private:
string _msg;
};
} // namespace MaterialX
#endif