Project
Loading...
Searching...
No Matches
MTWorkerHooks.h
Go to the documentation of this file.
1// Copyright 2019-2026 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
12#ifndef ALICEO2_BASE_MTWORKERHOOKS_H
13#define ALICEO2_BASE_MTWORKERHOOKS_H
14
15#include <functional>
16#include <memory>
17#include <fairmq/FwdDecls.h>
18
20
21namespace o2::data
22{
23class PrimaryChunk;
24}
25
26namespace o2::base
27{
28
33 std::function<std::unique_ptr<o2::data::PrimaryChunk>()> fetchChunk;
35 std::function<fair::mq::Channel*()> dataChannel;
37 std::function<TVirtualMCDecayer*()> makeDecayer;
39 std::function<void()> stopWorker;
41 std::function<void()> beginRunOnWorker;
43 std::function<void()> beforeTransport;
45 std::function<void()> beginTrack;
46
47 static MTWorkerHooks& instance();
48};
49
50} // namespace o2::base
51
52#endif
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
std::function< void()> beginRunOnWorker
Called on a worker thread at the start of each run, after its user actions exist.
std::function< fair::mq::Channel *()> dataChannel
Returns the calling thread's channel to the hit merger.
static MTWorkerHooks & instance()
std::function< std::unique_ptr< o2::data::PrimaryChunk >()> fetchChunk
Returns the next chunk of primaries for the calling thread, or nullptr when there is no more work.
std::function< void()> stopWorker
Ends the event loop of the calling thread after the current event.
std::function< void()> beforeTransport
Called once on the master thread after initialisation and before the first transport.
std::function< TVirtualMCDecayer *()> makeDecayer
Creates the external decayer of the calling thread (empty if there is none)
std::function< void()> beginTrack
Called on a worker thread at the start of each track.