defaultResolverContext.h
Go to the documentation of this file.
1 //
2 // Copyright 2018 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_USD_AR_DEFAULT_RESOLVER_CONTEXT_H
8 #define PXR_USD_AR_DEFAULT_RESOLVER_CONTEXT_H
9 
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/ar/api.h"
15 
16 #include <string>
17 #include <vector>
18 
19 PXR_NAMESPACE_OPEN_SCOPE
20 
47 {
48 public:
50  ArDefaultResolverContext() = default;
51 
55  AR_API ArDefaultResolverContext(const std::vector<std::string>& searchPath);
56 
57  AR_API bool operator<(const ArDefaultResolverContext& rhs) const;
58  AR_API bool operator==(const ArDefaultResolverContext& rhs) const;
59  AR_API bool operator!=(const ArDefaultResolverContext& rhs) const;
60 
62  const std::vector<std::string>& GetSearchPath() const
63  {
64  return _searchPath;
65  }
66 
68  AR_API std::string GetAsString() const;
69 
70 private:
71  std::vector<std::string> _searchPath;
72 };
73 
74 AR_API size_t
75 hash_value(const ArDefaultResolverContext& context);
76 
77 inline std::string
79 {
80  return context.GetAsString();
81 }
82 
84 
85 PXR_NAMESPACE_CLOSE_SCOPE
86 
87 #endif // PXR_USD_AR_DEFAULT_RESOLVER_CONTEXT_H
std::size_t hash_value(const half h)
Overload hash_value for half.
Definition: half.h:30
Resolver context object that specifies a search path to use during asset resolution.
const std::vector< std::string > & GetSearchPath() const
Return this context's search path.
Macros for defining an object for use with ArResolverContext.
std::string ArGetDebugString(const Context &context)
Default implementation for providing debug info on the contained context.
#define AR_DECLARE_RESOLVER_CONTEXT(ContextObject)
Declare that the specified ContextObject type may be used as an asset resolver context object for ArR...
ArDefaultResolverContext()=default
Default construct a context with no search path.
AR_API std::string GetAsString() const
Return a string representation of this context for debugging.