49 template <
typename Service>
52 static std::atomic<Service*> sService;
75 template <
typename Service>
78 return static_cast<Service&
>(
service(Service::iid()));
86 template <
typename Service>
92 template <
typename Service>
96 service_ptr<Service>() = &aService;
99 template <
typename Service>
103 service_ptr<Service>() =
nullptr;
106 template <
typename Service>
109 template <
typename Service>
112 template <
typename Service>
115 if (service_ptr<Service>() !=
nullptr)
116 return *service_ptr<Service>();
118 if (!service_registered<Service>())
122 return *service_ptr<Service>();
virtual ~i_service_provider()=default
virtual void register_service(i_service &aService, uuid aServiceIid)=0
virtual i_service & service(uuid aServiceIid)=0
virtual void unregister_service(uuid aServiceIid)=0
virtual bool service_registered(uuid aServiceIid) const =0
virtual ~i_service()=default
void register_service(Service &aService)
i_service_provider & allocate_service_provider()
void unregister_service(Service &aService)
bool service_registered()
Service & start_service()
void set_service_provider(i_service_provider &aServiceProvider)
std::atomic< Service * > & service_ptr()
i_service_provider & get_service_provider()
no_service_provider_instance()
service_provider_instance_exists()