blob: 869fe8906fcb62f8f2501a6282854f0ab93b6b9c [file] [log] [blame]
Patrick Venture3ecb3502019-05-17 11:03:51 -07001#pragma once
2
3#include <cstdint>
4
Patrick Venture1d5a31c2019-05-20 11:38:22 -07005namespace ipmi_flash
Patrick Venture3ecb3502019-05-17 11:03:51 -07006{
7
Patrick Ventureda66fd82019-06-03 11:11:24 -07008/** The status of the update mechanism or the verification mechanism */
9enum class ActionStatus : std::uint8_t
Patrick Venture8e801e12019-05-20 13:42:45 -070010{
11 running = 0,
12 success = 1,
13 failed = 2,
14 unknown = 3,
15};
16
Patrick Venture1d66fe62019-06-03 14:57:27 -070017class 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
Patrick Venture8e801e12019-05-20 13:42:45 -070036} // namespace ipmi_flash