xref: /openbmc/phosphor-ipmi-flash/status.hpp (revision 85e54f1b)
1 #pragma once
2 
3 #include <cstdint>
4 
5 namespace ipmi_flash
6 {
7 
8 /** The status of the update mechanism or the verification mechanism */
9 enum class ActionStatus : std::uint8_t
10 {
11     running = 0,
12     success = 1,
13     failed = 2,
14     unknown = 3,
15 };
16 
17 class TriggerableActionInterface
18 {
19   public:
20     virtual ~TriggerableActionInterface() = default;
21 
22     /**
23      * Trigger action.
24      *
25      * @return true if successfully started, false otherwise.
26      */
27     virtual bool trigger() = 0;
28 
29     /** Abort the action if possible. */
30     virtual void abort() = 0;
31 
32     /** Check the current state of the action. */
33     virtual ActionStatus status() = 0;
34 };
35 
36 } // namespace ipmi_flash
37