Unravel Engine C++ Reference
|
Template struct for managing compiled resources with handle allocators. More...
#include <RmlUi_RenderInterface.h>
Public Member Functions | |
compiled_resource_manager ()=default | |
~compiled_resource_manager ()=default | |
compiled_resource_manager (const compiled_resource_manager &)=delete | |
compiled_resource_manager & | operator= (const compiled_resource_manager &)=delete |
compiled_resource_manager (compiled_resource_manager &&)=delete | |
compiled_resource_manager & | operator= (compiled_resource_manager &&)=delete |
auto | alloc () -> uint16_t |
Allocate a new resource handle. | |
void | free (uint16_t handle_idx) |
Free a resource handle. | |
auto | is_valid (uint16_t handle_idx) const -> bool |
Check if a handle is valid. | |
auto | get (uint16_t handle_idx) -> CompiledType & |
Get resource by internal handle index. | |
auto | get (uint16_t handle_idx) const -> const CompiledType & |
Get resource by internal handle index (const version) | |
auto | get_num_handles () const -> uint16_t |
Get the number of allocated handles. | |
template<typename CleanupFunc > | |
void | cleanup_all (CleanupFunc cleanup_func) |
Cleanup all resources. | |
Static Public Member Functions | |
static auto | to_rml_handle (InternalHandle handle) -> RmlHandle |
Convert internal handle to RmlUi handle. | |
static auto | from_rml_handle (RmlHandle handle) -> InternalHandle |
Convert RmlUi handle to internal handle. | |
Template struct for managing compiled resources with handle allocators.
CompiledType | The type of compiled resource (e.g., CompiledTexture, CompiledFilter) |
InternalHandle | The internal handle type (e.g., compiled_texture_handle) |
RmlHandle | The RmlUi handle type (e.g., Rml::TextureHandle) |
MaxHandles | Maximum number of handles to support |
Definition at line 54 of file RmlUi_RenderInterface.h.
|
default |
|
default |
|
delete |
|
delete |
|
inline |
Allocate a new resource handle.
Definition at line 70 of file RmlUi_RenderInterface.h.
|
inline |
Cleanup all resources.
cleanup_func | Function to call for each valid resource before freeing |
Definition at line 155 of file RmlUi_RenderInterface.h.
|
inline |
Free a resource handle.
handle_idx | Internal handle index to free |
Definition at line 79 of file RmlUi_RenderInterface.h.
|
inlinestatic |
Convert RmlUi handle to internal handle.
handle | RmlUi handle |
Definition at line 134 of file RmlUi_RenderInterface.h.
|
inline |
Get resource by internal handle index.
handle_idx | Internal handle index |
Definition at line 104 of file RmlUi_RenderInterface.h.
|
inline |
Get resource by internal handle index (const version)
handle_idx | Internal handle index |
Definition at line 114 of file RmlUi_RenderInterface.h.
|
inline |
Get the number of allocated handles.
Definition at line 145 of file RmlUi_RenderInterface.h.
|
inline |
Check if a handle is valid.
handle_idx | Internal handle index to check |
Definition at line 94 of file RmlUi_RenderInterface.h.
|
delete |
|
delete |
|
inlinestatic |
Convert internal handle to RmlUi handle.
handle | Internal handle |
Definition at line 124 of file RmlUi_RenderInterface.h.