Represents a handle to an asset, providing access and management functions.
More...
#include <asset_handle.h>
|
auto | operator== (const asset_handle &rhs) const -> bool |
| Equality operator for asset handles.
|
|
auto | version () const -> uintptr_t |
|
| operator bool () const |
| Conversion operator to bool.
|
|
auto | id () const -> const std::string & |
| Gets the string identifier of the asset.
|
|
auto | uid () const -> const hpp::uuid & |
| Gets the unique identifier of the asset.
|
|
auto | name () const -> std::string |
| Gets the name of the asset derived from its path.
|
|
auto | extension () const -> std::string |
|
auto | get (bool wait=true) const -> std::shared_ptr< T > |
| Gets the shared pointer to the asset.
|
|
auto | is_valid () const -> bool |
| Checks if the handle is valid.
|
|
auto | is_ready () const -> bool |
| Checks if the task is ready.
|
|
auto | task_id () const |
| Gets the task ID.
|
|
void | set_internal_job (const typename asset_link_t::task_future_t &future) |
| Sets the internal job future.
|
|
void | set_internal_ids (const hpp::uuid &internal_uid, const std::string &internal_id=get_empty_id()) |
| Sets the internal IDs.
|
|
void | set_internal_id (const std::string &internal_id=get_empty_id()) |
| Sets the internal string identifier.
|
|
void | invalidate () |
| Invalidates the handle, resetting its state.
|
|
void | ensure () |
| Ensures the asset link is initialized.
|
|
template<typename T>
struct asset_handle< T >
Represents a handle to an asset, providing access and management functions.
- Template Parameters
-
Definition at line 42 of file asset_handle.h.
◆ asset_link_t
◆ ensure()
Ensures the asset link is initialized.
Definition at line 262 of file asset_handle.h.
◆ extension()
◆ get()
template<typename T >
auto asset_handle< T >::get |
( |
bool | wait = true | ) |
const -> std::shared_ptr<T>
|
|
inline |
Gets the shared pointer to the asset.
- Parameters
-
wait | If true, waits for the task to complete if not ready. |
- Returns
- The shared pointer to the asset.
Definition at line 119 of file asset_handle.h.
◆ get_empty()
Gets an empty asset handle.
- Returns
- The empty asset handle.
Definition at line 238 of file asset_handle.h.
◆ get_empty_id()
template<typename T >
static auto asset_handle< T >::get_empty_id |
( |
| ) |
-> const std::string&
|
|
inlinestatic |
Gets an empty string identifier.
- Returns
- The empty string identifier.
Definition at line 253 of file asset_handle.h.
◆ id()
Gets the string identifier of the asset.
- Returns
- The string identifier of the asset.
Definition at line 74 of file asset_handle.h.
◆ invalidate()
Invalidates the handle, resetting its state.
Definition at line 220 of file asset_handle.h.
◆ is_ready()
Checks if the task is ready.
- Returns
- True if the task is ready, false otherwise.
Definition at line 164 of file asset_handle.h.
◆ is_valid()
Checks if the handle is valid.
- Returns
- True if the handle is valid, false otherwise.
Definition at line 155 of file asset_handle.h.
◆ name()
Gets the name of the asset derived from its path.
- Returns
- The name of the asset.
Definition at line 104 of file asset_handle.h.
◆ operator bool()
Conversion operator to bool.
- Returns
- True if the handle is valid, false otherwise.
Definition at line 65 of file asset_handle.h.
◆ operator==()
Equality operator for asset handles.
- Parameters
-
rhs | The right-hand side asset handle. |
- Returns
- True if the handles are equal, false otherwise.
Definition at line 51 of file asset_handle.h.
◆ set_internal_id()
Sets the internal string identifier.
- Parameters
-
internal_id | The string identifier to set. |
Definition at line 211 of file asset_handle.h.
◆ set_internal_ids()
template<typename T >
void asset_handle< T >::set_internal_ids |
( |
const hpp::uuid & | internal_uid, |
|
|
const std::string & | internal_id = get_empty_id() ) |
|
inline |
Sets the internal IDs.
- Parameters
-
internal_uid | The unique identifier to set. |
internal_id | The string identifier to set. |
Definition at line 200 of file asset_handle.h.
◆ set_internal_job()
Sets the internal job future.
- Parameters
-
future | The task future to set. |
Definition at line 188 of file asset_handle.h.
◆ task_id()
◆ uid()
Gets the unique identifier of the asset.
- Returns
- The unique identifier of the asset.
Definition at line 89 of file asset_handle.h.
◆ version()
The documentation for this struct was generated from the following file:
- C:/Workspace/github/UnravelEngine/UnravelEngine/engine/engine/assets/asset_handle.h