MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ register_service()

template<typename Interface >
void MayaFlux::Registry::BackendRegistry::register_service ( ServiceFactory  factory)
inline

Register a backend service capability.

Template Parameters
InterfaceThe service interface type being provided
Parameters
factoryFactory function returning pointer to service implementation

Thread-safe. Multiple registrations of the same interface type will overwrite previous registrations, enabling backend hot-swapping.

The factory is called each time get_service() is invoked, allowing backends to return context-specific implementations if needed.

Example: registry.register_service<IBufferService>([this]() -> void* { return static_cast<IBufferService*>(&m_buffer_service_impl); });

Definition at line 89 of file BackendRegistry.hpp.

90 {
91 std::unique_lock lock(m_mutex);
92 m_services[typeid(Interface)] = std::move(factory);
93 }
std::unordered_map< ServiceId, ServiceFactory > m_services