Project
Loading...
Searching...
No Matches
o2::framework::ServiceRegistryRef Class Reference

#include <ServiceRegistryRef.h>

Classes

struct  thread_safe_zone
 

Public Member Functions

 ServiceRegistryRef (ServiceRegistry &registry, ServiceRegistry::Salt salt=ServiceRegistry::globalDeviceSalt())
 
bool isMainThread ()
 
template<typename T >
requires (std::is_const_v<T> == false)
bool active () const
 Check if service of type T is currently active.
 
template<typename T >
T & get () const
 
void registerService (ServiceTypeHash typeHash, void *service, ServiceKind kind, char const *name=nullptr) const
 
void registerService (ServiceHandle handle)
 
void lock ()
 
void unlock ()
 

Detailed Description

Definition at line 20 of file ServiceRegistryRef.h.

Constructor & Destructor Documentation

◆ ServiceRegistryRef()

o2::framework::ServiceRegistryRef::ServiceRegistryRef ( ServiceRegistry registry,
ServiceRegistry::Salt  salt = ServiceRegistry::globalDeviceSalt() 
)
inline

Definition at line 61 of file ServiceRegistryRef.h.

Member Function Documentation

◆ active()

template<typename T >
requires (std::is_const_v<T> == false)
bool o2::framework::ServiceRegistryRef::active ( ) const
inline

Check if service of type T is currently active.

Definition at line 76 of file ServiceRegistryRef.h.

◆ get()

template<typename T >
T & o2::framework::ServiceRegistryRef::get ( ) const
inline

Get a service for the given interface T. The returned reference exposed to the user is actually of the last concrete type C registered, however this should not be a problem.

Definition at line 85 of file ServiceRegistryRef.h.

◆ isMainThread()

bool o2::framework::ServiceRegistryRef::isMainThread ( )
inline

Definition at line 68 of file ServiceRegistryRef.h.

◆ lock()

void o2::framework::ServiceRegistryRef::lock ( )
inline

Definition at line 105 of file ServiceRegistryRef.h.

◆ registerService() [1/2]

void o2::framework::ServiceRegistryRef::registerService ( ServiceHandle  handle)
inline

Register a service given an handle, notice how the service will be created in the current salt, so that from a dataprocessor you cannot create a service globally, or in a stream you cannot create services for a dataprocessor.

Definition at line 100 of file ServiceRegistryRef.h.

◆ registerService() [2/2]

void o2::framework::ServiceRegistryRef::registerService ( ServiceTypeHash  typeHash,
void service,
ServiceKind  kind,
char const *  name = nullptr 
) const
inline

Definition at line 90 of file ServiceRegistryRef.h.

◆ unlock()

void o2::framework::ServiceRegistryRef::unlock ( )
inline

Definition at line 110 of file ServiceRegistryRef.h.


The documentation for this class was generated from the following file: