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
31
35
36 bool allDone = false;
39
40 // These are pointers to the one owned by the DataProcessingDevice
41 // but they are fully reentrant / thread safe and therefore can
42 // be accessed without a lock.
43
44 // FIXME: move stuff here from the list below... ;-)
46 std::vector<DataRelayer::RecordAction> completed;
47 std::vector<ExpirationHandler> expirationHandlers;
53
55
78
81
84
88 static void preExitCallbacks(std::vector<ServiceExitHandle>, ServiceRegistryRef);
89
91 void domainInfoUpdatedCallback(ServiceRegistryRef, size_t oldestPossibleTimeslice, ChannelIndex channelIndex);
92
94 void preSendingMessagesCallbacks(ServiceRegistryRef, fair::mq::Parts& parts, ChannelIndex channelindex);
95
98 mutable std::vector<ServiceProcessingHandle> preProcessingHandlers;
101 mutable std::vector<ServiceProcessingHandle> finaliseOutputsHandles;
104 mutable std::vector<ServiceProcessingHandle> postProcessingHandlers;
106 mutable std::vector<ServiceDanglingHandle> preDanglingHandles;
108 mutable std::vector<ServiceDanglingHandle> postDanglingHandles;
110 mutable std::vector<ServiceEOSHandle> preEOSHandles;
112 mutable std::vector<ServiceEOSHandle> postEOSHandles;
114 mutable std::vector<ServiceDispatchingHandle> postDispatchingHandles;
116 mutable std::vector<ServiceForwardingHandle> postForwardingHandles;
118 mutable std::vector<ServiceStartHandle> preStartHandles;
120 mutable std::vector<ServiceStopHandle> postStopHandles;
122 mutable std::vector<ServiceExitHandle> preExitHandles;
124 mutable std::vector<ServiceDomainInfoHandle> domainInfoHandles;
126 mutable std::vector<ServicePreSendingMessagesHandle> preSendingMessagesHandles;
128 mutable std::vector<ServicePreLoopHandle> preLoopHandles;
129
132 bool isSink = false;
133 bool balancingInputs = true;
134
137};
138
139} // namespace o2::framework
140#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 ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
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.
ForwardPolicy forwardPolicy
Wether or not the associated DataProcessor can forward things early.
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
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.