Project
Loading...
Searching...
No Matches
CommonServices.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11#ifndef O2_FRAMEWORK_COMMONSERVICES_H_
12#define O2_FRAMEWORK_COMMONSERVICES_H_
13
17
18namespace o2::framework
19{
20
21struct ThreadPool {
23};
24
28 template <typename T>
30 {
31 return []() -> uint32_t {
32 return TypeIdHelpers::uniqueId<T>();
33 };
34 }
37 template <typename I, typename T, enum ServiceKind KIND = ServiceKind::Serial>
39 {
40 return [](ServiceRegistryRef, DeviceState&, fair::mq::ProgOptions&) -> ServiceHandle {
41 return ServiceHandle{TypeIdHelpers::uniqueId<I>(), new T, KIND, typeid(T).name()};
42 };
43 }
44
46 template <typename I, typename T>
48 {
49 return [](ServiceRegistryRef, DeviceState&, fair::mq::ProgOptions&) -> ServiceHandle {
50 return ServiceHandle{TypeIdHelpers::uniqueId<I>(), T::instance(), ServiceKind::Serial, typeid(T).name()};
51 };
52 }
53
55 {
56 return [](InitContext&, void* service) -> void* { return service; };
57 }
58
65 static ServiceSpec controlSpec();
71 static ServiceSpec dataRelayer();
72 static ServiceSpec dataSender();
73 static ServiceSpec tracingSpec();
75 static ServiceSpec threadPool(int numWorkers);
78 static ServiceSpec objectCache();
82 static ServiceSpec asyncQueue();
86
87 static std::vector<ServiceSpec> defaultServices(std::string extraPlugins = "", int numWorkers = 0);
88 static std::vector<ServiceSpec> arrowServices();
89 static std::vector<ServiceSpec> requiredServices();
90};
91
92} // namespace o2::framework
93
94#endif // O2_FRAMEWORK_COMMONSERVICES_H_
GLuint const GLchar * name
Definition glcorearb.h:781
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
ServiceHandle(*)(ServiceRegistryRef, DeviceState &, fair::mq::ProgOptions &) ServiceInit
A callback to create a given Service.
Definition ServiceSpec.h:48
void *(*)(InitContext &, void *) ServiceConfigureCallback
Definition ServiceSpec.h:59
std::function< unsigned int()> ServiceId
A callback which returns the uniqueId of the service when invoked.
Definition ServiceSpec.h:46
static ServiceSpec dataRelayer()
static ServiceSpec callbacksSpec()
static ServiceSpec monitoringSpec()
static std::vector< ServiceSpec > requiredServices()
static ServiceSpec dataSender()
static ServiceSpec timesliceIndex()
static std::vector< ServiceSpec > defaultServices(std::string extraPlugins="", int numWorkers=0)
Split a string into a vector of strings using : as a separator.
static ServiceSpec timingInfoSpec()
static ServiceInit singletonServiceInit()
An helper to transform Singletons in to services, optionally configuring them.
static ServiceConfigureCallback noConfiguration()
static ServiceSpec asyncQueue()
static ServiceSpec decongestionSpec()
static ServiceSpec dataProcessorContextSpec()
static ServiceSpec dataProcessingStats()
static std::vector< ServiceSpec > arrowServices()
static ServiceSpec rootFileSpec()
static ServiceId simpleServiceId()
static ServiceSpec controlSpec()
static ServiceInit simpleServiceInit()
static ServiceSpec deviceContextSpec()
static ServiceSpec configurationSpec()
static ServiceSpec ccdbSupportSpec()
static ServiceSpec datatakingContextSpec()
static ServiceSpec guiMetricsSpec()
static ServiceSpec dataProcessingStates()
static ServiceSpec tracingSpec()
static ServiceSpec dataAllocatorSpec()
static ServiceSpec driverClientSpec()
static ServiceSpec streamContextSpec()
static ServiceSpec summaryServiceSpec()
static ServiceSpec threadPool(int numWorkers)
static ServiceSpec rawDeviceSpec()
static ServiceSpec parallelSpec()
Running state information of a given device.
Definition DeviceState.h:34