A RAII handle for a registered transfer handler. The handler is closed and deallocated when this object goes out of scope.
Public Member Functions | |
| TransferResource ()=default | |
| Creates an invalid handle. | |
| TransferResource (TransferHandlerAllocator &allocator, uint32_t resource_id) | |
| TransferResource (TransferResource &&other) noexcept | |
| TransferResource & | operator= (TransferResource &&other) noexcept |
| uint32_t | resource_id () const |
| operator bool () const | |
| void | Close () |
| Unregisters and deallocates the handler if this is a valid handle. | |
|
inline |
Constructs a TransferResource owned by allocator for resource_id.
| [in] | allocator | The TransferHandlerAllocator managing this resource. |
| [in] | resource_id | Assigned non-zero resource ID. |
|
inlineexplicit |
Checks whether this handle refers to an active registered resource.
true if this handle is valid, false otherwise.
|
inline |
Returns the resource ID associated with this handle, or 0 if invalid.
0 if this handle is invalid.