mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
[commands] Add pointer overload of AddRequirements (artf6003) (#3669)
Also update documentation in CommandBase.
This commit is contained in:
@@ -26,6 +26,10 @@ void CommandBase::AddRequirements(wpi::SmallSet<Subsystem*, 4> requirements) {
|
||||
m_requirements.insert(requirements.begin(), requirements.end());
|
||||
}
|
||||
|
||||
void CommandBase::AddRequirements(Subsystem* requirement) {
|
||||
m_requirements.insert(requirement);
|
||||
}
|
||||
|
||||
wpi::SmallSet<Subsystem*, 4> CommandBase::GetRequirements() const {
|
||||
return m_requirements;
|
||||
}
|
||||
|
||||
@@ -24,21 +24,38 @@ class CommandBase : public Command,
|
||||
public wpi::SendableHelper<CommandBase> {
|
||||
public:
|
||||
/**
|
||||
* Adds the specified requirements to the command.
|
||||
* Adds the specified Subsystem requirements to the command.
|
||||
*
|
||||
* @param requirements the requirements to add
|
||||
* @param requirements the Subsystem requirements to add
|
||||
*/
|
||||
void AddRequirements(std::initializer_list<Subsystem*> requirements);
|
||||
|
||||
/**
|
||||
* Adds the specified requirements to the command.
|
||||
* Adds the specified Subsystem requirements to the command.
|
||||
*
|
||||
* @param requirements the requirements to add
|
||||
* @param requirements the Subsystem requirements to add
|
||||
*/
|
||||
void AddRequirements(wpi::span<Subsystem* const> requirements);
|
||||
|
||||
/**
|
||||
* Adds the specified Subsystem requirements to the command.
|
||||
*
|
||||
* @param requirements the Subsystem requirements to add
|
||||
*/
|
||||
void AddRequirements(wpi::SmallSet<Subsystem*, 4> requirements);
|
||||
|
||||
/**
|
||||
* Adds the specified Subsystem requirement to the command.
|
||||
*
|
||||
* @param requirement the Subsystem requirement to add
|
||||
*/
|
||||
void AddRequirements(Subsystem* requirement);
|
||||
|
||||
/**
|
||||
* Gets the Subsystem requirements of the command.
|
||||
*
|
||||
* @return the Command's Subsystem requirements
|
||||
*/
|
||||
wpi::SmallSet<Subsystem*, 4> GetRequirements() const override;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user