AYON Usd Resolver  0.1.0
Loading...
Searching...
No Matches
assetIdentDef.h
Go to the documentation of this file.
1#ifndef ASSET_IDENT_DEF
2#define ASSET_IDENT_DEF
3
4#include <string>
5#include "pxr/pxr.h"
6#include "pxr/usd/ar/resolvedPath.h"
7
15
17 public:
18 assetIdent(): m_static(false) {
19 }
20 assetIdent(bool is_static): m_static(is_static) {
21 }
22 assetIdent(const std::string &assetIdentifier): m_assetIdentifier(assetIdentifier), m_static(false) {
23 }
24 assetIdent(const ArResolvedPath &path, const std::string &identifier, bool is_static):
26 m_assetIdentifier(identifier),
27 m_static(is_static) {
28 }
29
35 ArResolvedPath getResolvedAssetPath() const;
42 bool setResolvedAssetPath(const ArResolvedPath &inResolvedAssetPath);
43 bool setResolvedAssetPath(const std::string &inResolvedAssetPath);
44
48 std::string getAssetIdentifier() const;
49
56 bool setAssetIdentifier(const std::string inAssetIdentifier);
57
63 bool is_empty() const;
71 bool is_valid() const;
72
77 void invalidate();
78
83 void validate();
84
93 bool is_modifiable() const;
94
98 void printInfo() const;
99
100 bool operator==(const assetIdent &other) const;
101
102 assetIdent &operator=(const assetIdent &other);
103
104 private:
105 const bool m_static;
107 ArResolvedPath m_resolvedAssetPath;
108 std::string m_assetIdentifier;
109};
110
112 size_t
113 operator()(const assetIdent &instance) const {
114 return std::hash<std::string>()(instance.getAssetIdentifier());
115 }
116
117 size_t
118 operator()(const std::string &str) const {
119 return std::hash<std::string>()(str);
120 }
121};
122
123#endif // !ASSET_IDENT_DEF
cache element class used to represent an Usd asset in cache for the resolver
Definition: assetIdentDef.h:16
bool setAssetIdentifier(const std::string inAssetIdentifier)
allows you to set the internal m_assetIdentifier
Definition: assetIdentDef.cpp:37
ArResolvedPath getResolvedAssetPath() const
returns the ResolvedAssetPath for this assetIdent
Definition: assetIdentDef.cpp:10
assetIdent & operator=(const assetIdent &other)
Definition: assetIdentDef.cpp:98
bool is_valid() const
this function allows you to know if an given assetIdent's cache is still valid.
Definition: assetIdentDef.cpp:55
bool is_modifiable() const
allows you to know if you can modify the data in this assetIdent it is also used in getAssetIdentifie...
Definition: assetIdentDef.cpp:78
bool m_invalidated
Definition: assetIdentDef.h:106
void validate()
allows you to validate this assetIdent.
Definition: assetIdentDef.cpp:69
assetIdent(bool is_static)
Definition: assetIdentDef.h:20
std::string m_assetIdentifier
Definition: assetIdentDef.h:108
bool operator==(const assetIdent &other) const
Definition: assetIdentDef.cpp:93
std::string getAssetIdentifier() const
returns the asset identifier
Definition: assetIdentDef.cpp:32
bool setResolvedAssetPath(const ArResolvedPath &inResolvedAssetPath)
allows setting the ResolvedAssetPath
Definition: assetIdentDef.cpp:15
assetIdent(const std::string &assetIdentifier)
Definition: assetIdentDef.h:22
assetIdent(const ArResolvedPath &path, const std::string &identifier, bool is_static)
Definition: assetIdentDef.h:24
const bool m_static
Definition: assetIdentDef.h:105
void invalidate()
allows you to invalidate this assetIdent.
Definition: assetIdentDef.cpp:60
void printInfo() const
this function will print out all debug info about this assetIdent instance
Definition: assetIdentDef.cpp:83
bool is_empty() const
can be used to know if given assetIdent has data in it
Definition: assetIdentDef.cpp:46
ArResolvedPath m_resolvedAssetPath
Definition: assetIdentDef.h:107
assetIdent()
Definition: assetIdentDef.h:18
Definition: wrapResolverTokens.cpp:14
Definition: assetIdentDef.h:111
size_t operator()(const std::string &str) const
Definition: assetIdentDef.h:118
size_t operator()(const assetIdent &instance) const
Definition: assetIdentDef.h:113