22 #include <arpirobot/core/device/BaseDevice.hpp>
23 #include <arpirobot/core/scheduler.hpp>
33 typedef std::vector<std::reference_wrapper<BaseDevice>> LockedDeviceList;
79 virtual LockedDeviceList lockedDevices();
95 virtual void finish(
bool wasInterrupted) = 0;
105 static bool predDevice(std::reference_wrapper<BaseDevice> a, std::reference_wrapper<BaseDevice> b);
107 static bool compDevice(std::reference_wrapper<BaseDevice> a, std::reference_wrapper<BaseDevice> b);
109 static void makeDeviceListUnique(std::vector<std::reference_wrapper<BaseDevice>> &list);
111 void actionStart(
bool skipLock);
113 void actionStop(
bool interrupted);
115 void actionProcess();
121 std::shared_ptr<Task> _schedulerTask =
nullptr;
122 int32_t processRateMs = -1;
124 std::vector<std::reference_wrapper<BaseDevice>> currentlyLocked;
126 std::mutex stateLock;
127 bool started =
false;
128 bool finished =
false;
Definition: ActionManager.hpp:37
Definition: ActionSeries.hpp:34
Definition: Action.hpp:41
virtual bool shouldContinue()=0
int32_t getProcessPeriodMs()
virtual void finish(bool wasInterrupted)=0
Action(int32_t processRateMs=-1)
void setProcessPeriodMs(int32_t processPeriodMs)
Definition: ArduinoDevice.hpp:27