Project
Loading...
Searching...
No Matches
ControlService.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_CONTROLSERVICE_H_
12#define O2_FRAMEWORK_CONTROLSERVICE_H_
13
17#include <mutex>
18
19namespace o2::framework
20{
21
22struct ServiceRegistry;
23struct DeviceState;
24struct DriverClient;
25
26enum struct StreamingState : int;
27
29enum struct QuitRequest {
31 Me = 0,
33 All = 1,
34};
35
40{
41 public:
43
44 ControlService(ServiceRegistryRef registry, DeviceState& deviceState);
46 void readyToQuit(bool all) { this->readyToQuit(all ? QuitRequest::All : QuitRequest::Me); }
49 void readyToQuit(QuitRequest kind);
51 void endOfStream();
55 void push(std::string_view key, std::string_view value, int64_t timestamp);
57 void notifyDeviceState(std::string state);
58
59 private:
60 bool mOnce = false;
61 ServiceRegistryRef mRegistry;
62 DeviceState& mDeviceState O2_DPL_GUARDED_BY(mMutex);
63 DriverClient& mDriverClient O2_DPL_GUARDED_BY(mMutex);
64 std::mutex mMutex;
65};
66
67} // namespace o2::framework
68#endif // O2_FRAMEWORK_CONTROLSERVICE_H_
benchmark::State & state
#define O2_DPL_GUARDED_BY(x)
StringRef key
static constexpr ServiceKind service_kind
void readyToQuit(bool all)
Compatibility with old API.
void notifyStreamingState(StreamingState state)
Report the current streaming state of a given device.
void push(std::string_view key, std::string_view value, int64_t timestamp)
Push a generic key/value pair to the driver.
void endOfStream()
Signal that we are done with the current stream.
void notifyDeviceState(std::string state)
Report the current FairMQ state of a given device.
A service API to communicate with the driver.
GLsizei const GLfloat * value
Definition glcorearb.h:819
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
ServiceKind
The kind of service we are asking for.
QuitRequest
Kind of request we want to issue to control.
@ Me
Only quit this data processor.
@ All
Quit all data processor, regardless of their state.
Running state information of a given device.
Definition DeviceState.h:34