summaryrefslogtreecommitdiffstats
path: root/status.hpp
blob: 869fe8906fcb62f8f2501a6282854f0ab93b6b9c (plain)
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
#pragma once

#include <cstdint>

namespace ipmi_flash
{

/** The status of the update mechanism or the verification mechanism */
enum class ActionStatus : std::uint8_t
{
    running = 0,
    success = 1,
    failed = 2,
    unknown = 3,
};

class TriggerableActionInterface
{
  public:
    virtual ~TriggerableActionInterface() = default;

    /**
     * Trigger action.
     *
     * @return true if successfully started, false otherwise.
     */
    virtual bool trigger() = 0;

    /** Abort the action if possible. */
    virtual void abort() = 0;

    /** Check the current state of the action. */
    virtual ActionStatus status() = 0;
};

} // namespace ipmi_flash
OpenPOWER on IntegriCloud