#pragma once

#include <cstdint>
#include <functional>

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:
    using Callback = std::move_only_function<void(TriggerableActionInterface&)>;

    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;

    /** Sets the callback that is executed on completion of the trigger. */
    void setCallback(Callback&& cb)
    {
        this->cb = std::move(cb);
    }

  protected:
    Callback cb;
};

} // namespace ipmi_flash
