Project
Loading...
Searching...
No Matches
test_SimpleTimer.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/runDataProcessing.h
"
14
#include "
Framework/ControlService.h
"
15
16
#include <chrono>
17
#include <thread>
18
19
using namespace
o2::framework
;
20
21
// This is how you can define your processing in a declarative way
22
std::vector<DataProcessorSpec>
defineDataProcessing
(
ConfigContext
const
&)
23
{
24
return
{
25
DataProcessorSpec
{
26
"enumeration"
,
27
Inputs
{},
28
{},
29
AlgorithmSpec
{
30
adaptStateless
([](
ControlService
& control) {
31
// This is invoked autonomously by the timer.
32
std::this_thread::sleep_for(std::chrono::seconds(1));
33
control.
readyToQuit
(QuitRequest::All);
34
})}},
35
DataProcessorSpec
{
36
"atimer"
,
37
Inputs
{
38
InputSpec
{
"atimer"
,
"TST"
,
"TIMER"
, 0, Lifetime::Timer}},
39
{},
40
AlgorithmSpec
{
41
adaptStateless
([](
ControlService
& control) {
42
// This is invoked autonomously by the timer.
43
control.
readyToQuit
(QuitRequest::Me);
44
})}},
45
DataProcessorSpec
{
46
"btimer"
,
47
Inputs
{
48
InputSpec
{
"btimer"
,
"TST"
,
"TIMER2"
, 0, Lifetime::Timer}},
49
{},
50
AlgorithmSpec
{
51
adaptStateless
([](
ControlService
& control) {
52
// This is invoked autonomously by the timer.
53
control.
readyToQuit
(QuitRequest::Me);
54
})},
55
{
ConfigParamSpec
{
"period-btimer"
, VariantType::Int, 2000, {
"period of timer"
}}}}};
56
}
AlgorithmSpec.h
ControlService.h
DataRefUtils.h
o2::framework::ConfigContext
Definition
ConfigContext.h:24
o2::framework::ControlService
Definition
ControlService.h:40
o2::framework::ControlService::readyToQuit
void readyToQuit(bool all)
Compatibility with old API.
Definition
ControlService.h:46
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::adaptStateless
AlgorithmSpec::ProcessCallback adaptStateless(LAMBDA l)
Definition
AlgorithmSpec.h:229
o2::framework::Inputs
std::vector< InputSpec > Inputs
Definition
DataProcessorSpec.h:29
runDataProcessing.h
o2::framework::AlgorithmSpec
Definition
AlgorithmSpec.h:43
o2::framework::ConfigParamSpec
Definition
ConfigParamSpec.h:31
o2::framework::DataProcessorSpec
Definition
DataProcessorSpec.h:41
o2::framework::InputSpec
Definition
InputSpec.h:31
defineDataProcessing
std::vector< DataProcessorSpec > defineDataProcessing(ConfigContext const &)
This function hooks up the the workflow specifications into the DPL driver.
Definition
test_SimpleTimer.cxx:22
Framework
Core
test
test_SimpleTimer.cxx
Generated on Tue Feb 25 2025 23:16:40 for Project by
1.9.8