1 |
|
|
/** |
2 |
|
|
* @file ProcessMonitorConfig.hpp |
3 |
|
|
* @brief Header file for blink1_control::config::ProcessMonitorConfig |
4 |
|
|
*/ |
5 |
|
|
|
6 |
|
|
#pragma once |
7 |
|
|
|
8 |
|
|
#include <string> |
9 |
|
|
|
10 |
|
|
#include "config/ConditionConfig.hpp" |
11 |
|
|
|
12 |
|
|
//TODO operator<< |
13 |
|
|
|
14 |
|
|
namespace blink1_control::config { |
15 |
|
|
|
16 |
|
|
/** |
17 |
|
|
* Configuration for process monitors |
18 |
|
|
* |
19 |
|
|
* This is an extension of ConditionConfig |
20 |
|
|
* for the case where the type is ConditionConfig::Type::ProcessMonitor |
21 |
|
|
* |
22 |
|
|
* The state of the process monitor is based on running a command (stored |
23 |
|
|
* in ProcessMonitorConfig::cmd). |
24 |
|
|
* |
25 |
|
|
* If the process returns 0 then the monitor considers it good. If it |
26 |
|
|
* is non-zero then it is considered bad. If there are patterns on |
27 |
|
|
* this condition, there must be exactly two, and the first will |
28 |
|
|
* be used for the good case while the second will used for the bad case. |
29 |
|
|
*/ |
30 |
|
|
struct ProcessMonitorConfig : public ConditionConfig { |
31 |
|
|
|
32 |
|
|
/** |
33 |
|
|
* The command to run to monitor. |
34 |
|
|
*/ |
35 |
|
|
std::string cmd; |
36 |
|
|
|
37 |
|
6 |
virtual ~ProcessMonitorConfig() override = default; |
38 |
|
|
}; |
39 |
|
|
} |