![]() |
Open 3D Engine AzCore API Reference
2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
#include <Interface.h>
Inherited by AZ::Internal::IdHandler< Interface, Traits, ContainerType >, AZ::Internal::MultiHandler< Interface, Traits, ContainerType >, and AZ::Internal::NonIdHandler< Interface, Traits, ContainerType >.
Classes | |
class | Registrar |
Static Public Member Functions | |
static void | Register (T *type) |
static void | Unregister (T *type) |
static T * | Get () |
Interface class for accessing registered singletons across module boundaries. The raw interface pointer is handed to you; the assumption is that the registered system will outlive cached references. A system must register itself with the interface at initialization time by calling Register(); and unregister at shutdown by calling Unregister(). The provided Registrar class will do this for you automatically. Registration will only succeed after the AZ::Environment has been attached and is ready.
Example Usage:
|
static |
Returns the registered interface pointer, if it exists. This method is thread-safe in that you can call Get from multiple threads. Likewise, calls to Register / Unregister are guarded, but it is highly recommended to restrict Register / Unregister to a dedicated serial code path.
|
static |
Registers an instance pointer to the interface. Only one instance is allowed to register at a time.
|
static |
Unregisters from the interface. An unregister must occur in the same module as the original Register call; the pointer must match the original call to Register.