forked from mcoquet642/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDriverControl.h
More file actions
59 lines (52 loc) · 2.2 KB
/
DriverControl.h
File metadata and controls
59 lines (52 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef FRAMEWORK_DRIVERCONTROL_H
#define FRAMEWORK_DRIVERCONTROL_H
#include <functional>
#include <vector>
#include "Framework/CommandInfo.h"
#include "Framework/DriverInfo.h"
#include "Framework/DataProcessorSpec.h"
#include "Framework/DeviceSpec.h"
#include "Framework/DeviceExecution.h"
namespace o2
{
namespace framework
{
/// These are the possible states for the driver controller
/// and determine what should happen of state machine transitions.
enum struct DriverControlState { STEP,
PLAY,
PAUSE };
/// Controller for the driver process (i.e. / the one which calculates the
/// topology and actually spawns the devices ). Any operation to be done by
/// the driver process should be recorded in an instance of this, so that the
/// changes can be applied at the correct moment / state.
struct DriverControl {
using Callback = std::function<void(std::vector<DataProcessorSpec> const& workflow,
std::vector<DeviceSpec> const&,
std::vector<DeviceExecution> const&,
std::vector<DataProcessorInfo>&,
CommandInfo const&)>;
/// States to be added to the stack on next iteration
/// of the state machine processing.
std::vector<DriverState> forcedTransitions;
/// Current state of the state machine player.
DriverControlState state;
/// Callbacks to be performed by the driver next time it
/// goes in the "PERFORM_CALLBACK" state.
std::vector<Callback> callbacks;
bool defaultQuiet;
bool defaultStopped;
};
} // namespace framework
} // namespace o2
#endif