Loading...
Searching...
No Matches
UsdStageCache::Id Class Reference

A lightweight identifier that may be used to identify a particular cached stage within a UsdStageCache. More...

#include <stageCache.h>

Public Member Functions

 Id ()
 Default construct an invalid id.
 
long int ToLongInt () const
 Convert this Id to an integral representation.
 
std::string ToString () const
 Convert this Id to a string representation.
 
bool IsValid () const
 Return true if this Id is valid.
 
 operator bool () const
 Return true if this Id is valid.
 

Static Public Member Functions

static Id FromLongInt (long int val)
 Create an Id from an integral value.
 
static Id FromString (const std::string &s)
 Create an Id from a string value.
 

Friends

bool operator== (const Id &lhs, const Id &rhs)
 Equality comparison.
 
bool operator!= (const Id &lhs, const Id &rhs)
 Inequality comparison.
 
bool operator< (const Id &lhs, const Id &rhs)
 Less-than comparison.
 
bool operator<= (const Id &lhs, const Id &rhs)
 Less-than or equal comparison.
 
bool operator> (const Id &lhs, const Id &rhs)
 Greater-than comparison.
 
bool operator>= (const Id &lhs, const Id &rhs)
 Greater-than or equal comparison.
 
size_t hash_value (Id id)
 Hash.
 

Detailed Description

A lightweight identifier that may be used to identify a particular cached stage within a UsdStageCache.

An identifier may be converted to and from long int and string, to facilitate use within restricted contexts.

Id objects are only valid with the stage from which they were obtained. It never makes sense to use an Id with a stage other than the one it was obtained from.

Definition at line 98 of file stageCache.h.

Constructor & Destructor Documentation

◆ Id()

Id ( )
inline

Default construct an invalid id.

Definition at line 100 of file stageCache.h.

Member Function Documentation

◆ FromLongInt()

static Id FromLongInt ( long int  val)
inlinestatic

Create an Id from an integral value.

The supplied val must have been obtained by calling ToLongInt() previously.

Definition at line 104 of file stageCache.h.

◆ FromString()

static Id FromString ( const std::string &  s)
inlinestatic

Create an Id from a string value.

The supplied val must have been obtained by calling ToString() previously.

Definition at line 108 of file stageCache.h.

◆ IsValid()

bool IsValid ( ) const
inline

Return true if this Id is valid.

Definition at line 129 of file stageCache.h.

◆ operator bool()

operator bool ( ) const
inlineexplicit

Return true if this Id is valid.

Definition at line 132 of file stageCache.h.

◆ ToLongInt()

long int ToLongInt ( ) const
inline

Convert this Id to an integral representation.

Definition at line 121 of file stageCache.h.

◆ ToString()

std::string ToString ( ) const
inline

Convert this Id to a string representation.

Definition at line 124 of file stageCache.h.

Friends And Related Function Documentation

◆ hash_value

size_t hash_value ( Id  id)
friend

Hash.

Definition at line 160 of file stageCache.h.

◆ operator!=

bool operator!= ( const Id lhs,
const Id rhs 
)
friend

Inequality comparison.

Definition at line 140 of file stageCache.h.

◆ operator<

bool operator< ( const Id lhs,
const Id rhs 
)
friend

Less-than comparison.

Definition at line 144 of file stageCache.h.

◆ operator<=

bool operator<= ( const Id lhs,
const Id rhs 
)
friend

Less-than or equal comparison.

Definition at line 148 of file stageCache.h.

◆ operator==

bool operator== ( const Id lhs,
const Id rhs 
)
friend

Equality comparison.

Definition at line 136 of file stageCache.h.

◆ operator>

bool operator> ( const Id lhs,
const Id rhs 
)
friend

Greater-than comparison.

Definition at line 152 of file stageCache.h.

◆ operator>=

bool operator>= ( const Id lhs,
const Id rhs 
)
friend

Greater-than or equal comparison.

Definition at line 156 of file stageCache.h.


The documentation for this class was generated from the following file: