Project
Loading...
Searching...
No Matches
StreamContext.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_STREAMCONTEXT_H_
12#define O2_FRAMEWORK_STREAMCONTEXT_H_
13
16#include "ProcessingContext.h"
17#include "ServiceSpec.h"
18#include <functional>
19
20namespace o2::framework
21{
22
23struct ProcessingContext;
24
33
34 // Invoked once per stream before we start processing
35 // They are all guaranteed to be invoked before the PreRun
36 // function terminates.
37 // Notice this will mean that a StreamService which has
38 // a start callback might be created upfront.
40
46
48 void preEOSCallbacks(EndOfStreamContext& eosContext);
50 void postEOSCallbacks(EndOfStreamContext& eosContext);
51
53 std::vector<ServiceProcessingHandle> preProcessingHandles;
54 std::vector<ServiceProcessingHandle> finaliseOutputsHandles;
56 std::vector<ServiceProcessingHandle> postProcessingHandles;
57
59 std::vector<ServiceEOSHandle> preEOSHandles;
61 std::vector<ServiceEOSHandle> postEOSHandles;
62
63 // Callbacks for services to be executed before a stream starts processing
64 // Notice that in such a case all the services will be created upfront, so
65 // the callback will be called for all of them.
66 std::vector<ServiceStartStreamHandle> preStartStreamHandles;
67
70 std::vector<DataRelayer::RecordAction> completed;
71
72 // Information on wether or not all the required routes have been created.
73 // This is used to check if the LifetimeTimeframe routes were all created
74 // for a given iteration.
75 // This is in the stream context to allow tracking data creation on a per thread
76 // basis.
77 std::vector<bool> routeDPLCreated;
78 std::vector<bool> routeCreated;
79};
80
81} // namespace o2::framework
82
83#endif // O2_FRAMEWORK_DATAPROCESSINGCONTEXT_H_
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
ServiceKind
The kind of service we are asking for.
std::vector< ServiceProcessingHandle > postProcessingHandles
Callbacks for services to be executed after every process method invokation.
void finaliseOutputsCallbacks(ProcessingContext &)
Invoke callbacks to be executed after every process method invokation.
void preProcessingCallbacks(ProcessingContext &pcx)
Invoke callbacks to be executed before every process method invokation.
void preEOSCallbacks(EndOfStreamContext &eosContext)
Invoke callbacks to be executed before every EOS user callback invokation.
std::vector< DataRelayer::RecordAction > completed
std::vector< bool > routeDPLCreated
std::vector< ServiceStartStreamHandle > preStartStreamHandles
std::vector< ServiceProcessingHandle > finaliseOutputsHandles
void postProcessingCallbacks(ProcessingContext &pcx)
Invoke callbacks to be executed after every process method invokation.
std::vector< ServiceEOSHandle > postEOSHandles
Callbacks for services to be executed after every EOS user callback invokation.
std::vector< bool > routeCreated
void preStartStreamCallbacks(ServiceRegistryRef)
static constexpr ServiceKind service_kind
std::vector< ServiceEOSHandle > preEOSHandles
Callbacks for services to be executed before every EOS user callback invokation.
void postEOSCallbacks(EndOfStreamContext &eosContext)
Invoke callbacks to be executed after every EOS user callback invokation.
std::vector< ServiceProcessingHandle > preProcessingHandles
Callbacks for services to be executed before every process method invokation.