Container of a specific tuple of singleton resource types, available to tasks defined through a Scheduler.
More...
#include <GREM/execution/ResourceTable.hpp>
|
| template<resource T> |
| constexpr bool | hasResource () const noexcept |
| | Check if the table contains a specific resource.
|
| template<resource T> |
| constexpr T & | getResource () |
| | Get a specific resource in the table.
|
| template<resource T> |
| constexpr const T & | getResource () const |
| | Get a specific resource in the table.
|
| template<resource T> |
| constexpr T * | findResource () noexcept |
| | Try to get a specific resource in the table.
|
| template<resource T> |
| constexpr const T * | findResource () const noexcept |
| | Try to get a specific resource in the table.
|
| constexpr | Tuple (const Tuple &)=default |
| constexpr | Tuple (Tuple &&) noexcept((std::is_nothrow_move_constructible_v< Ts > &&... &&true))=default |
template<typename... ResourcesOrPointers>
class grem::execution::ResourceTable< ResourcesOrPointers >
Container of a specific tuple of singleton resource types, available to tasks defined through a Scheduler.
This container can be used as a simpler and more performant alternative to ResourceRegistry when the full set of resource types is known at compile time.
- Template Parameters
-
| ResourcesOrPointers | resource types, or pointers to external resources, to store in the table. |
- See also
- ResourceRegistry
◆ hasResource()
template<typename... ResourcesOrPointers>
|
|
inlinenodiscardconstexprnoexcept |
Check if the table contains a specific resource.
- Template Parameters
-
| T | resource type to check for. |
- Returns
- true if the table contains a resource of the specified type, false otherwise.
◆ getResource() [1/2]
template<typename... ResourcesOrPointers>
Get a specific resource in the table.
- Template Parameters
-
| T | resource type to get. Must be one of the resource types contained in the table. |
- Returns
- a reference to the specified resource.
◆ getResource() [2/2]
template<typename... ResourcesOrPointers>
Get a specific resource in the table.
- Template Parameters
-
| T | resource type to get. Must be one of the resource types contained in the table. |
- Returns
- a read-only reference to the specified resource.
◆ findResource() [1/2]
template<typename... ResourcesOrPointers>
|
|
inlinenodiscardconstexprnoexcept |
Try to get a specific resource in the table.
- Template Parameters
-
- Returns
- a pointer to the specified resource, or nullptr if the table does not contain a resource of the specified type.
◆ findResource() [2/2]
template<typename... ResourcesOrPointers>
|
|
inlinenodiscardconstexprnoexcept |
Try to get a specific resource in the table.
- Template Parameters
-
- Returns
- a read-only pointer to the specified resource, or nullptr if the table does not contain a resource of the specified type.
◆ Tuple() [1/2]
template<typename... ResourcesOrPointers>
◆ Tuple() [2/2]
template<typename... ResourcesOrPointers>
The documentation for this class was generated from the following file: