usdrt::TfToken
Defined in usdrt/scenegraph/base/tf/token.h
Functions
usdrt::TfToken::GetString: Get the string that this token represents.
usdrt::TfToken::GetText: Get the text that this token represents.
usdrt::TfToken::IsEmpty: Check if this token is empty.
usdrt::TfToken::TfToken: Acquire a token for the given string.
usdrt::TfToken::TfToken: Copy constructor.
usdrt::TfToken::TfToken: Move constructor.
usdrt::TfToken::TfToken: Aquire a token for the given string.
usdrt::TfToken::TfToken: Create the empty token containing omni::fabric::kUninitializedToken.
usdrt::TfToken::operator omni::fabric::Token: Explicit operator for std::move.
usdrt::TfToken::operator omni::fabric::TokenC: Explicit conversion operator for omni::fabric::TokenC, an integer key that identify paths to C-ABI interfaces.
usdrt::TfToken::operator!=: Inequality operator.
usdrt::TfToken::operator<: Less-than operator that compares tokenized strings lexicographically.
usdrt::TfToken::operator==: Equality operator [TODO more fabric info?].
usdrt::TfToken::pyUpdate: Update this token with a value from python.
usdrt::TfToken::size: Get the size of the string that this token represents.
-
class TfToken
Token for efficient comparison, assignment, and hashing of known strings.
A TfToken is a handle for a registered string, and can be compared, assigned, and hashed in constant time.
This implementation fairly simply wraps omni::fabric::Token.
Public Functions
-
inline TfToken()
Create the empty token containing omni::fabric::kUninitializedToken.
-
inline TfToken(const std::string &token)
Aquire a token for the given string.
- Parameters
token – String representation of token
-
inline TfToken(const char *token)
Acquire a token for the given string.
- Parameters
token – C-string representation of token
-
inline const std::string GetString() const
Get the string that this token represents.
- Returns
String representation of the token.
-
inline const char *GetText() const
Get the text that this token represents.
Note
The returned pointer value is not valid after this TfToken object has been destroyed.
- Returns
Return the C-string value that this token represents.
-
inline size_t size() const
Get the size of the string that this token represents.
- Returns
Return the size of the string that this token represents.
-
inline void pyUpdate(const char *fromPython)
Update this token with a value from python.
This is used in the python bindings for TfToken to convert from python strings.
// where source is the source PyObject* from python and // value is the result TfToken PyObject* tmp = PyObject_Str(source); value.pyUpdate(PyUnicode_AsUTF8(tmp));
See bindings/common.h [TODO link to this when documented]
- Parameters
fromPython – Value extracted from python in the TfToken custom python converter.
-
inline bool IsEmpty() const
Check if this token is empty.
- Returns
Return true if this token contains omni::fabric::kUninitializedToken, and false otherwise.
-
inline bool operator<(const TfToken &other) const
Less-than operator that compares tokenized strings lexicographically.
-
inline TfToken()