Project
Loading...
Searching...
No Matches
DriverClient.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_DRIVERCLIENT_H_
12#define O2_FRAMEWORK_DRIVERCLIENT_H_
13
16#include <functional>
17#include <string>
18#include <string_view>
19#include <vector>
20
21namespace o2::framework
22{
23
25 std::string prefix;
26 std::function<void(std::string_view)> callback;
27};
28
31{
32 public:
34
40 virtual void tell(char const* msg, size_t s, bool flush = true) = 0;
41 void tell(std::string_view const& msg, bool flush = true)
42 {
43 tell(msg.data(), msg.size(), flush);
44 };
45
47 void observe(char const* eventType, std::function<void(std::string_view)> callback);
48
50 void dispatch(std::string_view event);
51
60 virtual void flushPending(ServiceRegistryRef mainThreadRef) = 0;
61
62 private:
63 std::vector<DriverEventMatcher> mEventMatchers;
64};
65
66} // namespace o2::framework
67
68#endif // O2_FRAMEWORK_DRIVERCLIENT_H_
A service API to communicate with the driver.
void dispatch(std::string_view event)
Dispatch an event.
void observe(char const *eventType, std::function< void(std::string_view)> callback)
Request action on some eventType notified by the driver.
static constexpr ServiceKind service_kind
virtual void flushPending(ServiceRegistryRef mainThreadRef)=0
virtual void tell(char const *msg, size_t s, bool flush=true)=0
void tell(std::string_view const &msg, bool flush=true)
struct _cl_event * event
Definition glcorearb.h:2982
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
ServiceKind
The kind of service we are asking for.
std::function< void(std::string_view)> callback
uint64_t const void const *restrict const msg
Definition x9.h:153