HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Library.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_LIBRARY_H
7 #define MATERIALX_LIBRARY_H
8 
9 /// @file
10 /// Library-wide includes and types. This file should be the first include for
11 /// any public header in the MaterialX library.
12 
13 #include <algorithm>
14 #include <cstdlib>
15 #include <functional>
16 #include <memory>
17 #include <set>
18 #include <string>
19 #include <unordered_map>
20 #include <vector>
21 
23 
24 /// Platform-specific macros for declaring imported and exported symbols.
25 #if defined(MATERIALX_BUILD_SHARED_LIBS)
26  #if defined(_WIN32)
27  #pragma warning(disable : 4251)
28  #pragma warning(disable : 4275)
29  #pragma warning(disable : 4661)
30  #define MATERIALX_SYMBOL_EXPORT __declspec(dllexport)
31  #define MATERIALX_SYMBOL_IMPORT __declspec(dllimport)
32  #define MATERIALX_EXPORT_EXTERN_TEMPLATE(...) template class MATERIALX_SYMBOL_EXPORT __VA_ARGS__
33  #define MATERIALX_IMPORT_EXTERN_TEMPLATE(...) extern template class MATERIALX_SYMBOL_IMPORT __VA_ARGS__
34  #else
35  // Presently non-Windows platforms just export all symbols from
36  // shared libraries rather than using the explicit declarations.
37  #define MATERIALX_SYMBOL_EXPORT
38  #define MATERIALX_SYMBOL_IMPORT
39  #define MATERIALX_EXPORT_EXTERN_TEMPLATE(...)
40  #define MATERIALX_IMPORT_EXTERN_TEMPLATE(...)
41  #endif
42 #else
43  #define MATERIALX_SYMBOL_EXPORT
44  #define MATERIALX_SYMBOL_IMPORT
45  #define MATERIALX_EXPORT_EXTERN_TEMPLATE(...)
46  #define MATERIALX_IMPORT_EXTERN_TEMPLATE(...)
47 #endif
48 
50 
51 using std::string;
52 using std::vector;
53 using std::shared_ptr;
54 using std::weak_ptr;
55 
56 /// A vector of strings.
57 using StringVec = vector<string>;
58 /// An unordered map with strings as both keys and values.
59 using StringMap = std::unordered_map<string, string>;
60 /// A set of strings.
61 using StringSet = std::set<string>;
62 
64 
65 #endif
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
vector< string > StringVec
A vector of strings.
Definition: Library.h:57
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
std::unordered_map< string, string > StringMap
An unordered map with strings as both keys and values.
Definition: Library.h:59
std::set< string > StringSet
A set of strings.
Definition: Library.h:61
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:26