WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
Commands.hpp File Reference
#include <concepts>
#include <functional>
#include <memory>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "wpi/commands2/CommandPtr.hpp"
#include "wpi/commands2/Requirements.hpp"
#include "wpi/commands2/SelectCommand.hpp"
#include "wpi/util/deprecated.hpp"

Go to the source code of this file.

Namespaces

namespace  wpi
namespace  wpi::cmd
namespace  wpi::cmd::cmd
 Namespace for command factories.
namespace  wpi::cmd::cmd::impl

Functions

CommandPtr wpi::cmd::cmd::None ()
 Constructs a command that does nothing, finishing immediately.
CommandPtr wpi::cmd::cmd::Idle (Requirements requirements={})
 Constructs a command that does nothing until interrupted.
CommandPtr wpi::cmd::cmd::RunOnce (std::function< void()> action, Requirements requirements={})
 Constructs a command that runs an action once and finishes.
CommandPtr wpi::cmd::cmd::Run (std::function< void()> action, Requirements requirements={})
 Constructs a command that runs an action every iteration until interrupted.
CommandPtr wpi::cmd::cmd::StartEnd (std::function< void()> start, std::function< void()> end, Requirements requirements={})
 Constructs a command that runs an action once and another action when the command is interrupted.
CommandPtr wpi::cmd::cmd::RunEnd (std::function< void()> run, std::function< void()> end, Requirements requirements={})
 Constructs a command that runs an action every iteration until interrupted, and then runs a second action.
CommandPtr wpi::cmd::cmd::StartRun (std::function< void()> start, std::function< void()> run, Requirements requirements={})
 Constructs a command that runs an action once, and then runs an action every iteration until interrupted.
CommandPtr wpi::cmd::cmd::Print (std::string_view msg)
 Constructs a command that prints a message and finishes.
CommandPtr wpi::cmd::cmd::Wait (wpi::units::second_t duration)
 Constructs a command that does nothing, finishing after a specified duration.
CommandPtr wpi::cmd::cmd::WaitUntil (std::function< bool()> condition)
 Constructs a command that does nothing, finishing once a condition becomes true.
CommandPtr wpi::cmd::cmd::Either (CommandPtr &&onTrue, CommandPtr &&onFalse, std::function< bool()> selector)
 Runs one of two commands, based on the boolean selector function.
template<typename Key, std::convertible_to< CommandPtr >... CommandPtrs>
CommandPtr wpi::cmd::cmd::Select (std::function< Key()> selector, std::pair< Key, CommandPtrs > &&... commands)
 Runs one of several commands, based on the selector function.
CommandPtr wpi::cmd::cmd::Defer (wpi::util::unique_function< CommandPtr()> supplier, Requirements requirements)
 Runs the command supplied by the supplier.
CommandPtr wpi::cmd::cmd::DeferredProxy (wpi::util::unique_function< Command *()> supplier)
 Constructs a command that schedules the command returned from the supplier when initialized, and ends when it is no longer scheduled.
CommandPtr wpi::cmd::cmd::DeferredProxy (wpi::util::unique_function< CommandPtr()> supplier)
 Constructs a command that schedules the command returned from the supplier when initialized, and ends when it is no longer scheduled.
template<std::convertible_to< CommandPtr >... Args>
std::vector< CommandPtrwpi::cmd::cmd::impl::MakeVector (Args &&... args)
 Create a vector of commands.
CommandPtr wpi::cmd::cmd::Sequence (std::vector< CommandPtr > &&commands)
 Runs a group of commands in series, one after the other.
template<std::convertible_to< CommandPtr >... CommandPtrs>
CommandPtr wpi::cmd::cmd::Sequence (CommandPtrs &&... commands)
 Runs a group of commands in series, one after the other.
CommandPtr wpi::cmd::cmd::RepeatingSequence (std::vector< CommandPtr > &&commands)
 Runs a group of commands in series, one after the other.
template<std::convertible_to< CommandPtr >... CommandPtrs>
CommandPtr wpi::cmd::cmd::RepeatingSequence (CommandPtrs &&... commands)
 Runs a group of commands in series, one after the other.
CommandPtr wpi::cmd::cmd::Parallel (std::vector< CommandPtr > &&commands)
 Runs a group of commands at the same time.
template<std::convertible_to< CommandPtr >... CommandPtrs>
CommandPtr wpi::cmd::cmd::Parallel (CommandPtrs &&... commands)
 Runs a group of commands at the same time.
CommandPtr wpi::cmd::cmd::Race (std::vector< CommandPtr > &&commands)
 Runs a group of commands at the same time.
template<std::convertible_to< CommandPtr >... CommandPtrs>
CommandPtr wpi::cmd::cmd::Race (CommandPtrs &&... commands)
 Runs a group of commands at the same time.
CommandPtr wpi::cmd::cmd::Deadline (CommandPtr &&deadline, std::vector< CommandPtr > &&others)
 Runs a group of commands at the same time.
template<std::convertible_to< CommandPtr >... CommandPtrs>
CommandPtr wpi::cmd::cmd::Deadline (CommandPtr &&deadline, CommandPtrs &&... commands)
 Runs a group of commands at the same time.