#include <ServiceRegistry.h>
|
constexpr InstanceId | instanceFromTypeSalt (ServiceTypeHash type, Salt salt) const |
|
constexpr Index | indexFromInstance (InstanceId id) const |
|
void | throwError (const char *name, int64_t hash, int64_t streamId, int64_t dataprocessorId) const |
| To hide exception throwing from QC.
|
|
| ServiceRegistry () |
|
| ServiceRegistry (ServiceRegistry const &other) |
|
ServiceRegistry & | operator= (ServiceRegistry const &other) |
|
void | preExitCallbacks () |
| Invoke callbacks on exit.
|
|
void | postRenderGUICallbacks () |
|
void | declareService (ServiceSpec const &spec, DeviceState &state, fair::mq::ProgOptions &options, ServiceRegistry::Salt salt=ServiceRegistry::globalDeviceSalt()) |
|
void | bindService (ServiceRegistry::Salt salt, ServiceSpec const &spec, void *service) const |
|
void | lateBindStreamServices (DeviceState &state, fair::mq::ProgOptions &options, ServiceRegistry::Salt salt) |
|
void | registerService (ServiceTypeHash typeHash, void *service, ServiceKind kind, Salt salt, char const *name=nullptr, ServiceRegistry::SpecIndex specIndex=SpecIndex{-1}) const |
|
int | getPos (ServiceTypeHash typeHash, Salt salt) const |
|
void * | get (ServiceTypeHash typeHash, Salt salt, ServiceKind kind, char const *name=nullptr) const |
|
void | registerService (ServiceHandle handle, Salt salt=ServiceRegistry::globalDeviceSalt()) |
| Register a service given an handle.
|
|
template<class I , class C , enum ServiceKind K = ServiceKind::Serial>
requires std::is_base_of_v<I, C> |
void | registerService (C *service, Salt salt=ServiceRegistry::globalDeviceSalt()) |
|
template<class I , class C , enum ServiceKind K = ServiceKind::Serial>
requires std::is_base_of_v<I, C> |
void | registerService (C const *service, Salt salt=ServiceRegistry::globalDeviceSalt()) |
|
template<typename T >
requires (std::is_const_v<T> == false) |
bool | active (Salt salt) const |
| Check if service of type T is currently active.
|
|
template<typename T > |
T & | get (Salt salt) const |
|
void | postRenderGUICallbacks (ServiceRegistryRef ref) |
|
void | lock (Salt salt) const O2_DPL_ACQUIRE(mMutex) |
|
void | unlock (Salt salt) const O2_DPL_RELEASE(mMutex) |
|
Definition at line 78 of file ServiceRegistry.h.
◆ hash_type
◆ SpecialDataProcessorId
◆ SpecialStreamId
◆ ServiceRegistry() [1/2]
o2::framework::ServiceRegistry::ServiceRegistry |
( |
| ) |
|
◆ ServiceRegistry() [2/2]
o2::framework::ServiceRegistry::ServiceRegistry |
( |
ServiceRegistry const & |
other | ) |
|
◆ active()
template<typename T >
requires (std::is_const_v<T> == false)
bool o2::framework::ServiceRegistry::active |
( |
Salt |
salt | ) |
const |
|
inline |
◆ bindService()
◆ dataProcessorSalt()
static Salt o2::framework::ServiceRegistry::dataProcessorSalt |
( |
short |
dataProcessorId | ) |
|
|
inlinestatic |
A salt which is global to a specific data processor. This can be used to query properties which are not bonded to a specific stream, e.g. the name of the data processor, its inputs and outputs, it's algorithm.
Definition at line 161 of file ServiceRegistry.h.
◆ declareService()
Declare a service by its ServiceSpec. If of type Global / Serial it will be immediately registered for tid 0, so that subsequent gets will ultimately use it. If it is of kind "Stream" we will create the Service only when requested by a given thread. This function is not thread safe. salt is used to create the service in the proper context FIXME: for now we create everything in the global context
Definition at line 106 of file ServiceRegistry.cxx.
◆ get() [1/2]
template<typename T >
T & o2::framework::ServiceRegistry::get |
( |
Salt |
salt | ) |
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 305 of file ServiceRegistry.h.
◆ get() [2/2]
◆ getPos()
◆ globalDeviceSalt()
static Salt o2::framework::ServiceRegistry::globalDeviceSalt |
( |
| ) |
|
|
inlinestatic |
A salt which is global to the whole device. This can be used to query services which are not bound to a specific stream or data processor, e.g. the services to send metrics to the driver or to send messages to the control.
Definition at line 144 of file ServiceRegistry.h.
◆ globalStreamSalt()
static Salt o2::framework::ServiceRegistry::globalStreamSalt |
( |
short |
streamId | ) |
|
|
inlinestatic |
A salt which is global to a given stream but which multiple dataprocessors can share.
Definition at line 151 of file ServiceRegistry.h.
◆ indexFromInstance()
constexpr Index o2::framework::ServiceRegistry::indexFromInstance |
( |
InstanceId |
id | ) |
const |
|
inlineconstexpr |
◆ instanceFromTypeSalt()
◆ lateBindStreamServices()
◆ lock()
void o2::framework::ServiceRegistry::lock |
( |
Salt |
salt | ) |
const |
Lock the service registry for a given salt. For the moment this is a global lock for anything but stream services.
Definition at line 302 of file ServiceRegistry.cxx.
◆ operator=()
◆ postRenderGUICallbacks() [1/2]
void o2::framework::ServiceRegistry::postRenderGUICallbacks |
( |
| ) |
|
Invoke after rendering the GUI. Can be used to add custom GUI elements associated to a given service.
Definition at line 144 of file ServiceRegistry.cxx.
◆ postRenderGUICallbacks() [2/2]
Callback invoked by the driver after rendering. FIXME: Needs to stay here for the moment as it is used by the driver and not by one of the data processors.
Definition at line 265 of file ServiceRegistry.cxx.
◆ preExitCallbacks()
void o2::framework::ServiceRegistry::preExitCallbacks |
( |
| ) |
|
Invoke callbacks on exit.
◆ registerService() [1/4]
template<class I , class C , enum
ServiceKind K = ServiceKind::Serial>
requires std::is_base_of_v<I, C>
◆ registerService() [2/4]
template<class I , class C , enum
ServiceKind K = ServiceKind::Serial>
requires std::is_base_of_v<I, C>
◆ registerService() [3/4]
◆ registerService() [4/4]
Type erased service registration. typeHash is the hash used to identify the service, service is a type erased pointer to the service itself. This method is supposed to be thread safe
Definition at line 68 of file ServiceRegistry.cxx.
◆ streamSalt()
static Salt o2::framework::ServiceRegistry::streamSalt |
( |
short |
streamId, |
|
|
short |
dataProcessorId |
|
) |
| |
|
inlinestatic |
A salt which is specific to a given stream. This can be used to query properties which are of the stream itself, e.g. the currently processed time frame by a given stream.
Definition at line 171 of file ServiceRegistry.h.
◆ throwError()
void o2::framework::ServiceRegistry::throwError |
( |
const char * |
name, |
|
|
int64_t |
hash, |
|
|
int64_t |
streamId, |
|
|
int64_t |
dataprocessorId |
|
) |
| const |
◆ unlock()
void o2::framework::ServiceRegistry::unlock |
( |
Salt |
salt | ) |
const |
Unlock the service registry for a given salt. For the moment this is a global unlock for anything but stream services.
Definition at line 318 of file ServiceRegistry.cxx.
◆ valueFromKey()
static constexpr uint64_t o2::framework::ServiceRegistry::valueFromKey |
( |
Key |
key | ) |
|
|
inlinestaticconstexpr |
◆ valueFromSalt()
static constexpr int32_t o2::framework::ServiceRegistry::valueFromSalt |
( |
Salt |
salt | ) |
|
|
inlinestaticconstexpr |
◆ GLOBAL_CONTEXT_SALT
constexpr Salt o2::framework::ServiceRegistry::GLOBAL_CONTEXT_SALT {0, 0} |
|
staticconstexpr |
◆ lockCounter
std::atomic<int> o2::framework::ServiceRegistry::lockCounter = {0} |
|
mutable |
◆ MAX_DISTANCE
constexpr int32_t o2::framework::ServiceRegistry::MAX_DISTANCE = 8 |
|
staticconstexpr |
The maximum distance a entry can be from the optimal slot.
Definition at line 133 of file ServiceRegistry.h.
◆ MAX_SERVICES
constexpr uint32_t o2::framework::ServiceRegistry::MAX_SERVICES = 256 |
|
staticconstexpr |
◆ MAX_SERVICES_MASK
constexpr uint32_t o2::framework::ServiceRegistry::MAX_SERVICES_MASK = MAX_SERVICES - 1 |
|
staticconstexpr |
◆ mLastLock
int64_t o2::framework::ServiceRegistry::mLastLock = -1 |
|
mutable |
◆ mMutex
std::recursive_mutex o2::framework::ServiceRegistry::mMutex |
|
mutable |
◆ mPostRenderGUIHandles
Callbacks to be executed after the main GUI has been drawn.
Definition at line 190 of file ServiceRegistry.h.
◆ mServicesBooked
◆ mServicesKey
◆ mServicesMeta
◆ mServicesValue
◆ mSpecs
std::vector<ServiceSpec> o2::framework::ServiceRegistry::mSpecs |
|
mutable |
The documentation for this struct was generated from the following files: