HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
assetInfo.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 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_ASSET_INFO_H
8 #define PXR_USD_AR_ASSET_INFO_H
9 
10 /// \file ar/assetInfo.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/ar/api.h"
14 #include "pxr/base/tf/hash.h"
15 #include "pxr/base/vt/value.h"
16 #include <string>
17 
19 
20 /// \class ArAssetInfo
21 ///
22 /// Contains information about a resolved asset.
23 ///
25 {
26 public:
27  /// Version of the resolved asset, if any.
28  std::string version;
29 
30  /// The name of the asset represented by the resolved
31  /// asset, if any.
32  std::string assetName;
33 
34  /// \deprecated
35  /// The repository path corresponding to the resolved asset.
36  std::string repoPath;
37 
38  /// Additional information specific to the active plugin
39  /// asset resolver implementation.
41 };
42 
43 template <class HashState>
44 void TfHashAppend(HashState& h, const ArAssetInfo& info)
45 {
46  h.Append(info.version, info.assetName, info.repoPath, info.resolverInfo);
47 }
48 
49 inline
50 size_t hash_value(const ArAssetInfo& info)
51 {
52  return TfHash()(info);
53 }
54 
55 /// \relates ArAssetInfo
56 inline
57 void swap(ArAssetInfo& lhs, ArAssetInfo& rhs)
58 {
59  lhs.version.swap(rhs.version);
60  lhs.assetName.swap(rhs.assetName);
61  lhs.repoPath.swap(rhs.repoPath);
63 }
64 
65 /// \relates ArAssetInfo
66 AR_API
67 bool
68 operator==(const ArAssetInfo& lhs, const ArAssetInfo& rhs);
69 
70 /// \relates ArAssetInfo
71 AR_API
72 bool
73 operator!=(const ArAssetInfo& lhs, const ArAssetInfo& rhs);
74 
76 
77 #endif // PXR_USD_AR_ASSET_INFO_H
void swap(ArAssetInfo &lhs, ArAssetInfo &rhs)
Definition: assetInfo.h:57
size_t hash_value(const ArAssetInfo &info)
Definition: assetInfo.h:50
VtValue & Swap(VtValue &rhs) noexcept
Swap this with rhs.
Definition: value.h:955
#define AR_API
Definition: api.h:23
std::string repoPath
Definition: assetInfo.h:36
Definition: hash.h:472
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:556
std::string version
Version of the resolved asset, if any.
Definition: assetInfo.h:28
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
std::string assetName
Definition: assetInfo.h:32
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
void TfHashAppend(HashState &h, const ArAssetInfo &info)
Definition: assetInfo.h:44
Definition: value.h:146
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:542
VtValue resolverInfo
Definition: assetInfo.h:40