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.
15#include <Monitoring/Monitoring.h>
18#include "Framework/Logger.h"
19
20using namespace o2::framework;
22
25{
26 return WorkflowSpec{
27 //
29 "string_producer", //
30 Inputs{}, //
31 {
32 OutputSpec{{"make"}, "TES", "STRING"}, //
33 },
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 }, //
43 "string_consumer", //
44 {
45 InputSpec{"make", "TES", "STRING"}, //
46 }, //
47 Outputs{}, //
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}
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
std::vector< InputSpec > Inputs
std::vector< OutputSpec > Outputs
the main header struct
Definition DataHeader.h:618
WorkflowSpec defineDataProcessing(ConfigContext const &)
Example of how to send around strings using DPL.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"