ProxyCommand

class ProxyCommand : public Command

Schedules a Command as a “proxy” while tracking the progress for Sequence.

Warning

Only use when you need to free a Subsystem before or after it is used in a Sequence. This command should only be used when you really KNOW there is no other way to complete the action.

Public Functions

inline explicit ProxyCommand(const std::function<Command*()> &supplier)

Create a ProxyCommand with a Command pointer supplier.

Parameters:

supplier – Supplier to get a Command pointer on initialization

inline explicit ProxyCommand(Command *command)

Create a new ProxyCommand with a Command pointer.

Parameters:

command – The command to schedule as a proxy

inline virtual void initialize() override

Initialize the ProxyCommand and putting it into the CommandScheduler.

inline virtual bool isFinished() override

Creates the isFinished behavior to track the progress for Sequence.

Returns:

Returns true if the command is no longer scheduled

inline virtual void end(bool interrupted) override

Handles ending the task if ProxyCommand is interrupted.

Parameters:

interrupted – Cancels the Command is cancelled is true

inline virtual std::vector<Subsystem*> getRequirements() override

This Command has no requirements.

Returns:

This Command doesn’t require the Subsystem to make sure that it is free after use