Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
|
Manages a type identified list of components. More...
#include <foray_registry.hpp>
Public Member Functions | |
Registry () | |
Registry (CallbackDispatcher *root) | |
template<typename TComponent , typename... Args> | |
TComponent * | MakeComponent (Args &&... args) |
Instantiates a new componente. | |
template<typename TComponent > | |
void | AddComponent (TComponent *component) |
Adds a manually instantiated component instance (initiate with new, Registry manages finalization) | |
template<typename TComponent > | |
void | MoveComponent (TComponent *component) |
Moves a component registered to a different Registry to this. | |
template<typename TComponent > | |
bool | HasComponent () const |
Test wether a component matching type TComponent is registered. | |
template<typename TComponent > | |
TComponent * | GetComponent () |
Gets first component that can be cast to TComponent type. | |
template<typename TComponent > | |
const TComponent * | GetComponent () const |
Gets first component that can be cast to TComponent type. | |
template<typename TComponent > | |
int32_t | GetComponents (std::vector< TComponent * > &out) |
Appends all components which can be cast to TComponent type to the out vector. | |
template<typename TComponent > | |
int32_t | GetComponents (std::vector< const TComponent * > &out) const |
Appends all components which can be cast to TComponent type to the out vector. | |
bool | RemoveDeleteComponent (Component *component) |
Removes and finalizes a component. | |
virtual void | Destroy () |
Finalizes all attached components. | |
virtual | ~Registry () |
Registry & | SetCallbackDispatcher (CallbackDispatcher *rootRegistry) |
The root registry manages global callbacks invokable on the components. | |
![]() | |
NoMoveDefaults ()=default | |
NoMoveDefaults (const NoMoveDefaults &other)=delete | |
NoMoveDefaults (NoMoveDefaults &&other)=default | |
NoMoveDefaults & | operator= (const NoMoveDefaults &other)=delete |
Protected Member Functions | |
void | Register (Component *component) |
bool | Unregister (Component *component) |
void | RegisterToRoot (Component *component) |
void | UnregisterFromRoot (Component *component) |
Protected Attributes | |
CallbackDispatcher * | mCallbackDispatcher = nullptr |
All components attached to the registry. | |
std::vector< Component * > | mComponents = {} |
Manages a type identified list of components.
|
inline |
|
inline |
|
inlinevirtual |
|
inline |
Adds a manually instantiated component instance (initiate with new, Registry manages finalization)
Finalizes all attached components.
Reimplemented in foray::scene::Scene.
|
inline |
Gets first component that can be cast to TComponent type.
|
inline |
Gets first component that can be cast to TComponent type.
|
inline |
Appends all components which can be cast to TComponent type to the out vector.
|
inline |
Appends all components which can be cast to TComponent type to the out vector.
|
inline |
Test wether a component matching type TComponent is registered.
|
inline |
Instantiates a new componente.
|
inline |
Moves a component registered to a different Registry to this.
Removes and finalizes a component.
|
inline |
The root registry manages global callbacks invokable on the components.
|
protected |
All components attached to the registry.
|
protected |