Project
Loading...
Searching...
No Matches
DataProcessingContext.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_DATAPROCESSORCONTEXT_H_
12#define O2_FRAMEWORK_DATAPROCESSORCONTEXT_H_
13
16#include <functional>
17
18namespace o2::framework
19{
20
21struct DeviceContext;
22struct ServiceRegistry;
23struct DataAllocator;
25
29
30 bool allDone = false;
33
34 // These are pointers to the one owned by the DataProcessingDevice
35 // but they are fully reentrant / thread safe and therefore can
36 // be accessed without a lock.
37
38 // FIXME: move stuff here from the list below... ;-)
40 std::vector<DataRelayer::RecordAction> completed;
41 std::vector<ExpirationHandler> expirationHandlers;
47
49
72
75
78
82 static void preExitCallbacks(std::vector<ServiceExitHandle>, ServiceRegistryRef);
83
85 void domainInfoUpdatedCallback(ServiceRegistryRef, size_t oldestPossibleTimeslice, ChannelIndex channelIndex);
86
88 void preSendingMessagesCallbacks(ServiceRegistryRef, fair::mq::Parts& parts, ChannelIndex channelindex);
89
92 mutable std::vector<ServiceProcessingHandle> preProcessingHandlers;
95 mutable std::vector<ServiceProcessingHandle> finaliseOutputsHandles;
98 mutable std::vector<ServiceProcessingHandle> postProcessingHandlers;
100 mutable std::vector<ServiceDanglingHandle> preDanglingHandles;
102 mutable std::vector<ServiceDanglingHandle> postDanglingHandles;
104 mutable std::vector<ServiceEOSHandle> preEOSHandles;
106 mutable std::vector<ServiceEOSHandle> postEOSHandles;
108 mutable std::vector<ServiceDispatchingHandle> postDispatchingHandles;
110 mutable std::vector<ServiceForwardingHandle> postForwardingHandles;
112 mutable std::vector<ServiceStartHandle> preStartHandles;
114 mutable std::vector<ServiceStopHandle> postStopHandles;
116 mutable std::vector<ServiceExitHandle> preExitHandles;
118 mutable std::vector<ServiceDomainInfoHandle> domainInfoHandles;
120 mutable std::vector<ServicePreSendingMessagesHandle> preSendingMessagesHandles;
122 mutable std::vector<ServicePreLoopHandle> preLoopHandles;
123
125 bool canForwardEarly = true;
126 bool isSink = false;
127 bool balancingInputs = true;
128
131};
132
133} // namespace o2::framework
134#endif // O2_FRAMEWORK_DATAPROCESSINGCONTEXT_H_
The input API of the Data Processing Layer This class holds the inputs which are valid for processing...
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::function< ProcessCallback(InitContext &)> InitCallback
std::function< void(InitErrorContext &)> InitErrorCallback
std::function< void(ProcessingContext &)> ProcessCallback
std::function< void(ErrorContext &)> ErrorCallback
std::vector< ServicePreSendingMessagesHandle > preSendingMessagesHandles
Callbacks for services to be executed before sending messages.
std::vector< ServiceDanglingHandle > preDanglingHandles
Callbacks for services to be executed before every dangling check.
std::vector< ServiceEOSHandle > postEOSHandles
Callbacks for services to be executed after every EOS user callback invokation.
int64_t lastRunNumberProcessed
Latest run number we processed globally for this DataProcessor.
void preSendingMessagesCallbacks(ServiceRegistryRef, fair::mq::Parts &parts, ChannelIndex channelindex)
Invoke before sending messages parts on a channel channelindex.
std::vector< ServiceEOSHandle > preEOSHandles
Callbacks for services to be executed before every EOS user callback invokation.
std::function< void(o2::framework::RuntimeErrorRef e, InputRecord &record)> errorHandling
void postDispatchingCallbacks(ProcessingContext &)
Invoke callbacks to be executed after every data Dispatching.
AlgorithmSpec::InitErrorCallback initError
std::vector< ServiceDomainInfoHandle > domainInfoHandles
Callbacks for services to be executed on exit.
std::vector< ServiceStartHandle > preStartHandles
Callbacks for services to be executed before Start.
void finaliseOutputsCallbacks(ProcessingContext &)
std::vector< ServicePreLoopHandle > preLoopHandles
Callbacks for services to be executed before we enter the event loop.
std::function< void(o2::framework::RuntimeErrorRef e)> initErrorHandling
std::vector< ExpirationHandler > expirationHandlers
void preLoopCallbacks(ServiceRegistryRef)
Invoke callbacks before we enter the event loop.
std::vector< ServiceProcessingHandle > postProcessingHandlers
void postStopCallbacks(ServiceRegistryRef)
Invoke callbacks on stop.
void preEOSCallbacks(EndOfStreamContext &)
Invoke callbacks to be executed before every EOS user callback invokation.
std::vector< ServiceForwardingHandle > postForwardingHandles
Callbacks for services to be executed after every dispatching.
void preProcessingCallbacks(ProcessingContext &)
Invoke callbacks to be executed before every process method invokation.
std::vector< ServiceDispatchingHandle > postDispatchingHandles
Callbacks for services to be executed after every dispatching.
std::vector< ServiceExitHandle > preExitHandles
Callbacks for services to be executed on exit.
void postEOSCallbacks(EndOfStreamContext &)
Invoke callbacks to be executed after every EOS user callback invokation.
void domainInfoUpdatedCallback(ServiceRegistryRef, size_t oldestPossibleTimeslice, ChannelIndex channelIndex)
Invoke whenever we get a new DomainInfo message.
std::vector< DataRelayer::RecordAction > completed
std::vector< ServiceStopHandle > postStopHandles
Callbacks for services to be executed on the Stop transition.
AlgorithmSpec::ProcessCallback statelessProcess
bool canForwardEarly
Wether or not the associated DataProcessor can forward things early.
DataProcessorContext(DataProcessorContext const &)=delete
static void preExitCallbacks(std::vector< ServiceExitHandle >, ServiceRegistryRef)
Invoke callback to be executed on exit, in reverse order.
std::vector< ServiceProcessingHandle > finaliseOutputsHandles
std::vector< ServiceDanglingHandle > postDanglingHandles
Callbacks for services to be executed after every dangling check.
void postProcessingCallbacks(ProcessingContext &)
Invoke callbacks to be executed after every process method invokation.
void preStartCallbacks(ServiceRegistryRef)
Invoke callbacks to be executed in PreRun(), before the User Start callbacks.
std::vector< ServiceProcessingHandle > preProcessingHandlers
void postForwardingCallbacks(ProcessingContext &)
Callback invoked after the late forwarding has been done.
AlgorithmSpec::ProcessCallback statefulProcess
void preDanglingCallbacks(DanglingContext &)
Invoke callbacks to be executed before every dangling check.
void postDanglingCallbacks(DanglingContext &)
Invoke callbacks to be executed after every dangling check.