Skip to content

EntropyEngine::Core::EntropyServiceRegistry

EntropyEngine::Core::EntropyServiceRegistry

Section titled “EntropyEngine::Core::EntropyServiceRegistry”

Registry and lifecycle orchestrator for EntropyService instances. More…

#include <EntropyServiceRegistry.h>

Name
~EntropyServiceRegistry()
boolunregisterService(const TypeSystem::TypeID & tid)
Unregister a service by type.
template <typename T >
bool
unregisterService()
voidunloadAll()
voidstopAll()
voidstartAll()
size_tserviceCount() const
boolregisterService(RefObject< EntropyService > service)
template <typename TService >
bool
registerService(RefObject< TService > service)
EntropyServiceRegistry &operator=(const EntropyServiceRegistry & ) =delete
EntropyServiceRegistry &operator=(EntropyServiceRegistry && ) =delete
voidloadAll()
boolisValid(const EntropyService * service) const
Validate a service is still registered with matching generation.
boolhas(const TypeSystem::TypeID & tid) const
template <typename T >
bool
has() const
template <typename T >
WeakRef< T >
getWeak() const
Get weak reference to service by type.
RefObject< EntropyService >get(const TypeSystem::TypeID & tid) const
template <typename T >
RefObject< T >
get() const
EntropyServiceRegistry() =default
EntropyServiceRegistry(const EntropyServiceRegistry & ) =delete
EntropyServiceRegistry(EntropyServiceRegistry && ) =delete
class EntropyEngine::Core::EntropyServiceRegistry;

Registry and lifecycle orchestrator for EntropyService instances.

Services are registered and looked up by static TypeID (RTTI-less). The registry can load/start/stop/unload all registered services honoring their declared type dependencies.

Services are stamped with handle identity (owner/index/generation) on registration, enabling generation-based validation and WeakRef support for safe cross-subsystem references.

~EntropyServiceRegistry()
bool unregisterService(
const TypeSystem::TypeID & tid
)

Unregister a service by type.

Return: true if service was found and unregistered

Clears the service’s handle stamp and removes it from the registry. The slot’s generation is incremented to invalidate stale WeakRefs.

template <typename T >
inline bool unregisterService()
void unloadAll()
void stopAll()
void startAll()
inline size_t serviceCount() const
bool registerService(
RefObject< EntropyService > service
)
template <typename TService >
inline bool registerService(
RefObject< TService > service
)
EntropyServiceRegistry & operator=(
const EntropyServiceRegistry &
) =delete
EntropyServiceRegistry & operator=(
EntropyServiceRegistry &&
) =delete
void loadAll()
bool isValid(
const EntropyService * service
) const

Validate a service is still registered with matching generation.

bool has(
const TypeSystem::TypeID & tid
) const
template <typename T >
inline bool has() const
template <typename T >
inline WeakRef< T > getWeak() const

Get weak reference to service by type.

Return: WeakRef to the service, empty if not found

Returns a WeakRef that does not prevent service unregistration. Caller must lock() before use and handle the case where service is gone.

RefObject< EntropyService > get(
const TypeSystem::TypeID & tid
) const
template <typename T >
inline RefObject< T > get() const
EntropyServiceRegistry() =default
EntropyServiceRegistry(
const EntropyServiceRegistry &
) =delete
EntropyServiceRegistry(
EntropyServiceRegistry &&
) =delete

Updated on 2026-01-26 at 16:50:32 -0500