Project
Loading...
Searching...
No Matches
test_DanglingOutputs.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
#include "
Framework/ConfigParamSpec.h
"
12
#include "
Framework/DeviceSpec.h
"
13
#include "
Framework/runDataProcessing.h
"
14
#include "
Framework/ControlService.h
"
15
16
#include <chrono>
17
#include <thread>
18
#include <vector>
19
20
using namespace
o2::framework
;
21
22
AlgorithmSpec
simplePipe
(std::string
const
& what,
int
minDelay)
23
{
24
return
AlgorithmSpec
{[what, minDelay](
InitContext
& ic) {
25
srand(getpid());
26
return
[what, minDelay](
ProcessingContext
& ctx) {
27
auto
& bData = ctx.outputs().make<
int
>(
OutputRef
{what}, 1);
28
};
29
}};
30
}
31
32
// a1 is not actually used by anything, however it might.
33
WorkflowSpec
defineDataProcessing
(
ConfigContext
const
& specs)
34
{
35
return
WorkflowSpec
{
36
{
"A"
,
37
Inputs
{},
38
{
OutputSpec
{{
"a1"
},
"TST"
,
"A1"
},
39
OutputSpec
{{
"a2"
},
"TST"
,
"A2"
}},
40
AlgorithmSpec
{
41
[](
ProcessingContext
& ctx) {
42
std::this_thread::sleep_for(std::chrono::milliseconds((rand() % 2 + 1) * 1000));
43
auto
& aData1 = ctx.outputs().make<
int
>(
OutputRef
{
"a1"
}, 1);
44
auto
& aData2 = ctx.outputs().make<
int
>(
Output
{
"TST"
,
"A2"
}, 1);
45
ctx.services().get<
ControlService
>().endOfStream();
46
}}},
47
{
"B"
,
48
{
InputSpec
{{
"a1"
},
"TST"
,
"A1"
}},
49
{},
50
AlgorithmSpec
{
51
[](
ProcessingContext
& ctx) {
52
}}}};
53
}
ConfigParamSpec.h
ControlService.h
DeviceSpec.h
o2::framework::ConfigContext
Definition
ConfigContext.h:24
o2::framework::ControlService
Definition
ControlService.h:40
o2::framework::InitContext
Definition
InitContext.h:25
o2::framework::ProcessingContext
Definition
ProcessingContext.h:27
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::WorkflowSpec
std::vector< DataProcessorSpec > WorkflowSpec
Definition
HBFUtilsInitializer.h:39
o2::framework::Inputs
std::vector< InputSpec > Inputs
Definition
DataProcessorSpec.h:29
runDataProcessing.h
o2::framework::AlgorithmSpec
Definition
AlgorithmSpec.h:43
o2::framework::InputSpec
Definition
InputSpec.h:31
o2::framework::OutputRef
Definition
OutputRef.h:29
o2::framework::OutputSpec
Definition
OutputSpec.h:33
o2::framework::Output
Definition
Output.h:27
defineDataProcessing
WorkflowSpec defineDataProcessing(ConfigContext const &specs)
This function hooks up the the workflow specifications into the DPL driver.
Definition
test_DanglingOutputs.cxx:33
simplePipe
AlgorithmSpec simplePipe(std::string const &what, int minDelay)
Definition
test_DanglingOutputs.cxx:22
Framework
Core
test
test_DanglingOutputs.cxx
Generated on Tue Feb 25 2025 23:16:40 for Project by
1.9.8