Project
Loading...
Searching...
No Matches
DriverClient.cxx
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
13#include <regex>
14
15namespace o2::framework
16{
17
18void DriverClient::observe(const char* eventPrefix, std::function<void(std::string_view)> callback)
19{
20 mEventMatchers.push_back({eventPrefix, callback});
21}
22
23void DriverClient::dispatch(std::string_view event)
24{
25 for (auto& handle : mEventMatchers) {
26 if (event.rfind(handle.prefix, 0) == 0) {
27 handle.callback(event);
28 }
29 }
30}
31
32} // namespace o2::framework
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.
struct _cl_event * event
Definition glcorearb.h:2982
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20