-
Notifications
You must be signed in to change notification settings - Fork 496
Expand file tree
/
Copy pathDriverControl.h
More file actions
56 lines (49 loc) · 2.03 KB
/
DriverControl.h
File metadata and controls
56 lines (49 loc) · 2.03 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
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// 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 "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>&)>;
/// 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