11#ifndef O2_FRAMEWORK_SERVICEREGISTRYREF_H_
12#define O2_FRAMEWORK_SERVICEREGISTRYREF_H_
62 : mRegistry(registry),
75 requires(std::is_const_v<T> ==
false)
78 return mRegistry.
active<T>(mSalt);
87 return mRegistry.
get<T>(mSalt);
107 mRegistry.
lock(mSalt);
bool active() const
Check if service of type T is currently active.
ServiceRegistryRef(ServiceRegistry ®istry, ServiceRegistry::Salt salt=ServiceRegistry::globalDeviceSalt())
void registerService(ServiceHandle handle)
void registerService(ServiceTypeHash typeHash, void *service, ServiceKind kind, char const *name=nullptr) const
GLuint const GLchar * name
Defining PrimaryVertex explicitly as messageable.
ServiceKind
The kind of service we are asking for.
ServiceKind kind
Kind of service.
void * instance
Type erased pointer to a service.
unsigned int hash
Unique hash associated to the type of service.
std::string name
Mnemonic name to use for the service.
ServiceRegistryRef & mRef
thread_safe_zone(thread_safe_zone const &)=delete
thread_safe_zone & operator=(thread_safe_zone const &)=delete
thread_safe_zone(ServiceRegistryRef &ref)
void unlock(Salt salt) const O2_DPL_RELEASE(mMutex)
void registerService(ServiceTypeHash typeHash, void *service, ServiceKind kind, Salt salt, char const *name=nullptr, ServiceRegistry::SpecIndex specIndex=SpecIndex{-1}) const
bool active(Salt salt) const
Check if service of type T is currently active.
static Salt globalDeviceSalt()
void * get(ServiceTypeHash typeHash, Salt salt, ServiceKind kind, char const *name=nullptr) const
void lock(Salt salt) const O2_DPL_ACQUIRE(mMutex)