ResourceRegistry Class
Unified type-indexed registry for all engine resources. More...
Declaration
Public Member Functions Index
template <class T, class... Args> | |
| T & | emplace (Args &&... args) |
|
Registers and constructs a resource of type T. More... | |
template <class T> | |
| bool | has () const noexcept |
|
Checks if a resource of type T is registered. More... | |
template <class T> | |
| T * | tryGet () const noexcept |
|
Retrieves a registered resource by type. More... | |
template <class T> | |
| T & | get () const noexcept |
|
Retrieves a registered resource by type (checked). More... | |
| std::span< Manager *const > | managers () const noexcept |
|
Returns a read-only span of all registered Managers. More... | |
| std::span< Manager * > | managers () noexcept |
|
Returns a read-only span of all registered Managers. More... | |
| std::span< CommandBuffer *const > | commandBuffers () const noexcept |
|
Returns a read-only span of all registered CommandBuffers. More... | |
| std::span< CommandBuffer * > | commandBuffers () noexcept |
|
Returns a read-only span of all registered CommandBuffers. More... | |
Private Member Attributes Index
| ManagerRegistry | managerRegistry_ |
| CommandBufferRegistry | commandBufferRegistry_ |
|
Registry for CommandBuffer instances. More... | |
Description
Unified type-indexed registry for all engine resources.
ResourceRegistry acts as the central access point for Managers and CommandBuffers. It delegates to a ManagerRegistry and a CommandBufferRegistry internally, routing registration and lookup based on compile-time concept checks (IsManagerLike / IsCommandBufferLike).
- See Also
- See Also
- See Also
Definition at line 48 of file ResourceRegistry.ixx.
Public Member Functions
commandBuffers()
| inline noexcept |
Returns a read-only span of all registered CommandBuffers.
- Returns
Span of CommandBuffer pointers in registration order.
Definition at line 178 of file ResourceRegistry.ixx.
commandBuffers()
| inline noexcept |
Returns a read-only span of all registered CommandBuffers.
- Returns
Span of CommandBuffer pointers in registration order.
Definition at line 185 of file ResourceRegistry.ixx.
emplace()
| inline |
Registers and constructs a resource of type T.
Routes to ManagerRegistry or CommandBufferRegistry based on whether T satisfies IsManagerLike or IsCommandBufferLike. The resource is constructed in-place with forwarded arguments.
- Template Parameters
-
T The resource type. Must satisfy IsManagerLike or IsCommandBufferLike.
Args Constructor argument types.
- Parameters
-
args Arguments forwarded to the T constructor.
- Returns
Reference to the newly registered resource.
Definition at line 78 of file ResourceRegistry.ixx.
get()
| inline noexcept |
Retrieves a registered resource by type (checked).
Asserts that the resource is registered before returning.
- Template Parameters
-
T The resource type.
- Returns
Reference to the resource.
- Precondition
The resource must be registered.
Definition at line 144 of file ResourceRegistry.ixx.
Reference has.
has()
| inline noexcept |
Checks if a resource of type T is registered.
- Template Parameters
-
T The resource type.
- Returns
True if the resource is registered.
Definition at line 99 of file ResourceRegistry.ixx.
Referenced by get.
managers()
| inline nodiscard noexcept |
Returns a read-only span of all registered Managers.
- Returns
Span of Manager pointers in registration order.
Definition at line 162 of file ResourceRegistry.ixx.
managers()
| inline noexcept |
Returns a read-only span of all registered Managers.
- Returns
Span of Manager pointers in registration order.
Definition at line 169 of file ResourceRegistry.ixx.
tryGet()
| inline noexcept |
Retrieves a registered resource by type.
- Template Parameters
-
T The resource type.
- Returns
Pointer to the resource, or nullptr if not registered.
Definition at line 119 of file ResourceRegistry.ixx.
Private Member Attributes
commandBufferRegistry_
|
Registry for CommandBuffer instances.
Definition at line 58 of file ResourceRegistry.ixx.
managerRegistry_
|
Registry for Manager instances.
Definition at line 53 of file ResourceRegistry.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.