blob: 2ae93771e740e764681c843365325535ab0fb9da [file] [log] [blame]
Patrick Ventured53d60a2020-04-07 09:01:34 -07001#pragma once
2
3#include "status.hpp"
4
5#include <memory>
6
7namespace ipmi_flash
8{
9
10// This type will just return success upon trigger(), and even before calling
11// trigger.
12class SkipAction : public TriggerableActionInterface
13{
14 public:
15 static std::unique_ptr<TriggerableActionInterface> CreateSkipAction();
16
17 SkipAction() = default;
18 ~SkipAction() = default;
19
20 // Disallow copy and assign.
21 SkipAction(const SkipAction&) = delete;
22 SkipAction& operator=(const SkipAction&) = delete;
23 SkipAction(SkipAction&&) = default;
24 SkipAction& operator=(SkipAction&&) = default;
25
26 bool trigger() override
27 {
28 return true;
29 }
30 void abort() override
31 {
32 }
33 ActionStatus status() override
34 {
35 return ActionStatus::success;
36 }
37};
38
39} // namespace ipmi_flash