|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Dynamic container of singleton resource instances, available to tasks defined through a Scheduler. More...
#include <GREM/execution/ResourceRegistry.hpp>

Public Member Functions | |
| ~ResourceRegistry ()=default | |
| Destructor. | |
| ResourceRegistry (ResourceRegistry &&) noexcept=default | |
| Move constructor. | |
| ResourceRegistry (const ResourceRegistry &other) | |
| Copy constructor. | |
| ResourceRegistry & | operator= (ResourceRegistry &&) noexcept=default |
| Move assignment. | |
| ResourceRegistry & | operator= (const ResourceRegistry &other) |
| Copy assignment. | |
| void | clear () noexcept |
| Erase all resources from the registry. | |
| template<resource T, typename... Args> | |
| T & | addResource (Args &&... args) |
| Add an owned resource to the registry. | |
| template<resource T, typename... Args> | |
| T * | addResourceIfMissing (Args &&... args) |
| Add an owned resource to the registry if it doesn't already have it. | |
| template<resource T> | |
| T & | addResourceOrAssign (T &&value) |
| Add an owned resource to the registry, or assign a new value to the existing resource if the registry already has it. | |
| template<resource T, typename... Args> | |
| T & | addSharedResource (Args &&... args) |
| Add a reference-counted resource to the registry, whose ownership is shared between copies of the registry. | |
| template<resource T, typename... Args> | |
| T * | addSharedResourceIfMissing (Args &&... args) |
| Add a reference-counted resource to the registry, whose ownership is shared between copies of the registry, if it doesn't already have it. | |
| template<resource T> | |
| T & | addSharedResourceOrAssign (T &&value) |
| Add a reference-counted resource to the registry, whose ownership is shared between copies of the registry, or assign a new value to the existing resource if the registry already has it. | |
| template<resource T> | |
| T & | addExternalResource (T *resource) |
| Add an unowned external resource reference to the registry. | |
| template<resource T> | |
| T * | addExternalResourceIfMissing (T *resource) |
| Add an unowned external resource reference to the registry if it doesn't already have it. | |
| template<resource T> | |
| bool | removeResource () noexcept |
| Erase a resource from the registry. | |
| template<resource T> | |
| bool | hasResource () const noexcept |
| Check if the registry contains a specific resource. | |
| template<resource T> | |
| T & | getResource () |
| Get a specific resource in the registry. | |
| template<resource T> | |
| const T & | getResource () const |
| Get a specific resource in the registry. | |
| template<resource T> | |
| T * | findResource () noexcept |
| Try to get a specific resource in the registry. | |
| template<resource T> | |
| const T * | findResource () const noexcept |
| Try to get a specific resource in the registry. | |
| constexpr | Tuple (const Tuple &)=default |
| constexpr | Tuple (Tuple &&) noexcept((std::is_nothrow_move_constructible_v< Ts > &&... &&true))=default |
Dynamic container of singleton resource instances, available to tasks defined through a Scheduler.
This container supports extending the set of possible resource types dynamically at runtime.
| KnownResourcesOrPointers | compile-time-known set of possible resource types, or pointers to external resources, which are given dedicated slots in the resource registry to speed up access to them. Any unknown resource types that are not in this list will be stored in a dynamic associative container keyed by the resource's typeid, which is looked up at runtime, incurring some performance overhead. |
|
default |
Destructor.
|
defaultnoexcept |
Move constructor.
|
inline |
Copy constructor.
|
defaultnoexcept |
Move assignment.
|
inline |
Copy assignment.
|
inlinenoexcept |
Erase all resources from the registry.
|
inline |
Add an owned resource to the registry.
| T | resource type to add. |
| args | arguments to forward to the resource constructor. |
| std::logic_error | if the registry already contained a resource of the specified type. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the resource constructor. |
|
inline |
Add an owned resource to the registry if it doesn't already have it.
| T | resource type to add. |
| args | arguments to forward to the resource constructor. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the resource constructor. |
|
inline |
Add an owned resource to the registry, or assign a new value to the existing resource if the registry already has it.
| T | resource type to add. |
| value | value of the resource to add or assign. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the resource's copy/move constructor or copy/move assignment operator. |
|
inline |
Add a reference-counted resource to the registry, whose ownership is shared between copies of the registry.
| T | resource type to add. |
| args | arguments to forward to the resource constructor. |
| std::logic_error | if the registry already contained a resource of the specified type. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the resource constructor. |
|
inline |
Add a reference-counted resource to the registry, whose ownership is shared between copies of the registry, if it doesn't already have it.
| T | resource type to add. |
| args | arguments to forward to the resource constructor. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the resource constructor. |
|
inline |
Add a reference-counted resource to the registry, whose ownership is shared between copies of the registry, or assign a new value to the existing resource if the registry already has it.
| T | resource type to add. |
| value | value of the resource to add or assign. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the resource's copy/move constructor or copy/move assignment operator. |
|
inline |
Add an unowned external resource reference to the registry.
| T | resource type to add. |
| resource | non-owning pointer to the resource to add to the registry. Must not be nullptr. |
| std::logic_error | if the registry already contained a resource of the specified type. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Add an unowned external resource reference to the registry if it doesn't already have it.
| T | resource type to add. |
| resource | non-owning pointer to the resource to add to the registry. Must not be nullptr. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenoexcept |
Erase a resource from the registry.
| T | resource type to remove. |
|
inlinenodiscardnoexcept |
Check if the registry contains a specific resource.
| T | resource type to check for. |
|
inlinenodiscard |
Get a specific resource in the registry.
| T | resource type to get. |
| std::out_of_range | if the registry does not contain a resource of the specified type. |
|
inlinenodiscard |
Get a specific resource in the registry.
| T | resource type to get. |
| std::out_of_range | if the registry does not contain a resource of the specified type. |
|
inlinenodiscardnoexcept |
Try to get a specific resource in the registry.
| T | resource type to get. |
|
inlinenodiscardnoexcept |
Try to get a specific resource in the registry.
| T | resource type to get. |
|
constexprdefault |
|
constexprdefaultnoexcept |