Class HoldRepeatCommandMapping
Defined in File hold_repeat_command_mapping.hpp
Inheritance Relationships
Base Type
public tap::control::CommandMapping
(Class CommandMapping)
Class Documentation
-
class HoldRepeatCommandMapping : public tap::control::CommandMapping
A CommandMapping that adds
Command
s when the contained mapping is a subset of the remote mapping. If a Command finishes and the contained mapping is still a subset of the remote mapping, it is added again. It then removes theCommand
s when the mapping is no longer a subset if endCommandsWhenNotHeld is true, or doesn’t end commands if endCommandsWhenNotHeld is false. Furthermore, will stop scheduling commands if maxTimesToSchedule is not -1 after the command has been added to the scheduler maxTimesToSchedule.Additionally, When neg keys are being used and the mapping’s neg keys are a subset of the remote map state, the
Command
s are removed.Public Functions
-
inline HoldRepeatCommandMapping(Drivers *drivers, const std::vector<Command*> cmds, const RemoteMapState &rms, bool endCommandsWhenNotHeld, int maxTimesToSchedule = -1)
Constructor must take the set of
Command
s and the RemoteMapState.- Parameters:
drivers – [in] Global drivers instance.
cmds – [in] vector of commands that will be scheduled by this command mapping.
rms – [in] RemoteMapState that controls when commands will be scheduled.
endCommandsWhenNotHeld – [in] If
true
, the commands will be forcibly ended by the command mapping when no longer being held. Otherwise, the commands will naturally finish.maxTimesToSchedule – [in] Number of times to reschedule each of the commands. If -1 is passed in, the command mapping will continue to reschedule the commands forever. If there are multiple commands that have the potential to end, each command will be scheduled maxTimesToSchedule.
-
~HoldRepeatCommandMapping() override = default
Default destructor.
-
virtual void executeCommandMapping(const RemoteMapState &currState) override
-
inline void setMaxTimesToSchedule(int maxTimes)
Set the maximum times each of commands should be re-scheduled.
-
inline HoldRepeatCommandMapping(Drivers *drivers, const std::vector<Command*> cmds, const RemoteMapState &rms, bool endCommandsWhenNotHeld, int maxTimesToSchedule = -1)