Project
Loading...
Searching...
No Matches
test_SimpleStringProcessing.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/DataRefUtils.h
"
12
#include "
Framework/AlgorithmSpec.h
"
13
#include "
Framework/ServiceRegistry.h
"
14
#include "
Framework/runDataProcessing.h
"
15
#include <Monitoring/Monitoring.h>
16
#include "
Framework/ControlService.h
"
17
#include "
Framework/CallbackService.h
"
18
#include "
Framework/Logger.h
"
19
20
using namespace
o2::framework
;
21
using
DataHeader
=
o2::header::DataHeader
;
22
24
WorkflowSpec
defineDataProcessing
(
ConfigContext
const
&)
25
{
26
return
WorkflowSpec
{
27
//
28
DataProcessorSpec
{
29
"string_producer"
,
//
30
Inputs
{},
//
31
{
32
OutputSpec
{{
"make"
},
"TES"
,
"STRING"
},
//
33
},
34
AlgorithmSpec
{[](
ProcessingContext
& ctx) {
35
auto
& out1 = ctx.outputs().make<std::string>(
Output
{
"TES"
,
"STRING"
},
"default"
);
36
assert(out1 ==
"default"
);
37
out1 =
"Hello"
;
38
ctx.services().get<
ControlService
>().endOfStream();
39
ctx.services().get<
ControlService
>().readyToQuit(QuitRequest::Me);
40
}}
//
41
},
//
42
DataProcessorSpec
{
43
"string_consumer"
,
//
44
{
45
InputSpec
{
"make"
,
"TES"
,
"STRING"
},
//
46
},
//
47
Outputs
{},
//
48
AlgorithmSpec
{
49
[](
ProcessingContext
& ctx) {
50
auto
s = ctx.inputs().get<std::string>(
"make"
);
51
52
if
(s !=
"Hello"
) {
53
LOG
(error) <<
"Expecting `Hello', found `"
<< s <<
"'"
;
54
}
else
{
55
LOG
(info) <<
"Everything OK"
;
56
}
57
}
//
58
}
//
59
}
//
60
};
61
}
AlgorithmSpec.h
CallbackService.h
ControlService.h
DataRefUtils.h
Logger.h
ServiceRegistry.h
o2::framework::ConfigContext
Definition
ConfigContext.h:24
o2::framework::ControlService
Definition
ControlService.h:40
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
o2::framework::Outputs
std::vector< OutputSpec > Outputs
Definition
DataProcessorSpec.h:30
runDataProcessing.h
o2::framework::AlgorithmSpec
Definition
AlgorithmSpec.h:43
o2::framework::DataProcessorSpec
Definition
DataProcessorSpec.h:41
o2::framework::InputSpec
Definition
InputSpec.h:31
o2::framework::OutputSpec
Definition
OutputSpec.h:33
o2::framework::Output
Definition
Output.h:27
o2::header::DataHeader
the main header struct
Definition
DataHeader.h:618
defineDataProcessing
WorkflowSpec defineDataProcessing(ConfigContext const &)
Example of how to send around strings using DPL.
Definition
test_SimpleStringProcessing.cxx:24
LOG
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
Framework
Core
test
test_SimpleStringProcessing.cxx
Generated on Tue Feb 25 2025 23:16:40 for Project by
1.9.8