MaterialX 1.39.2
Loading...
Searching...
No Matches
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
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
22#include <MaterialXCore/Generated.h>
23
24#define MATERIALX_GENERATE_INDEX(major, minor, build) \
25 ((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | ((uint32_t)(build)))
26#define MATERIALX_VERSION_INDEX \
27 MATERIALX_GENERATE_INDEX(MATERIALX_MAJOR_VERSION, MATERIALX_MINOR_VERSION, MATERIALX_BUILD_VERSION)
28
30#if defined(MATERIALX_BUILD_SHARED_LIBS)
31 #if defined(_WIN32)
32 #pragma warning(disable : 4251)
33 #pragma warning(disable : 4275)
34 #pragma warning(disable : 4661)
35 #define MATERIALX_SYMBOL_EXPORT __declspec(dllexport)
36 #define MATERIALX_SYMBOL_IMPORT __declspec(dllimport)
37 #define MATERIALX_EXPORT_EXTERN_TEMPLATE(...) template class MATERIALX_SYMBOL_EXPORT __VA_ARGS__
38 #define MATERIALX_IMPORT_EXTERN_TEMPLATE(...) extern template class MATERIALX_SYMBOL_IMPORT __VA_ARGS__
39 #else
40 #define MATERIALX_SYMBOL_EXPORT __attribute__((__visibility__("default")))
41 #define MATERIALX_SYMBOL_IMPORT __attribute__((__visibility__("default")))
42 #define MATERIALX_EXPORT_EXTERN_TEMPLATE(...) template class MATERIALX_SYMBOL_EXPORT __VA_ARGS__
43 #define MATERIALX_IMPORT_EXTERN_TEMPLATE(...) extern template class MATERIALX_SYMBOL_IMPORT __VA_ARGS__
44 #endif
45#else
46 #define MATERIALX_SYMBOL_EXPORT
47 #define MATERIALX_SYMBOL_IMPORT
48 #define MATERIALX_EXPORT_EXTERN_TEMPLATE(...)
49 #define MATERIALX_IMPORT_EXTERN_TEMPLATE(...)
50#endif
51
52MATERIALX_NAMESPACE_BEGIN
53
54using std::string;
55using std::vector;
56using std::shared_ptr;
57using std::weak_ptr;
58
60using StringVec = vector<string>;
62using StringMap = std::unordered_map<string, string>;
64using StringSet = std::set<string>;
65
66MATERIALX_NAMESPACE_END
67
68#endif
std::set< string > StringSet
A set of strings.
Definition Library.h:64
vector< string > StringVec
A vector of strings.
Definition Library.h:60
std::unordered_map< string, string > StringMap
An unordered map with strings as both keys and values.
Definition Library.h:62