|
constexpr | Handle (NullType) |
|
constexpr | Handle (T index) |
|
template<typename U > |
constexpr | Handle (U index) |
|
constexpr bool | operator== (const Handle &rhs) const |
|
constexpr bool | operator!= (const Handle &rhs) const |
|
constexpr bool | operator< (const Handle &rhs) const |
|
constexpr bool | operator> (const Handle &rhs) const |
|
constexpr bool | operator<= (const Handle &rhs) const |
|
void | Reset () |
| Resets the handle to NullIndex.
|
|
constexpr T | GetIndex () const |
| Returns the index currently stored in the handle.
|
|
constexpr bool | IsNull () const |
| Returns whether the handle is equal to NullIndex.
|
|
constexpr bool | IsValid () const |
| Returns whether the handle is NOT equal to NullIndex.
|
|
template<typename T = uint32_t, typename NamespaceType = DefaultNamespaceType>
struct AZ::RHI::Handle< T, NamespaceType >
Handle a simple wrapper around an integral type, which adds the formal concept of a 'Null' value. It is designed to accommodate a zero-based 'index' where a value of 0 is considered valid. As such, the null value is equal to -1 casted to the type.
- Template Parameters
-
T | An integral type held by the Handle container. A value of -1 (or max value for unsigned types) is reserved for the null index. |
NamespaceType | An optional typename used to create a compile-time unique variant of Handle. This disallows trivial copying of unrelated 'types'. Useful to make a handle variant typed to a client class. |
Sample Usage:
class Foo;
FooHandle fooHandle;
class Bar;
BarHandle barHandle;
fooHandle = barHandle;
fooHandle.GetIndex();
fooHandle = 15;
fooHandle.GetIndex();
fooHandle.IsNull();
constexpr bool IsNull() const
Returns whether the handle is equal to NullIndex.
Definition: Handle.h:155