mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[commands] Add owning overload to ProxyScheduleCommand (#4405)
This commit is contained in:
@@ -15,6 +15,13 @@ ProxyScheduleCommand::ProxyScheduleCommand(Command* toSchedule) {
|
||||
SetInsert(m_toSchedule, {&toSchedule, 1});
|
||||
}
|
||||
|
||||
ProxyScheduleCommand::ProxyScheduleCommand(
|
||||
std::unique_ptr<Command>&& toSchedule)
|
||||
: m_owning(std::move(toSchedule)) {
|
||||
Command* ptr = m_owning.get();
|
||||
SetInsert(m_toSchedule, {&ptr, 1});
|
||||
}
|
||||
|
||||
void ProxyScheduleCommand::Initialize() {
|
||||
for (auto* command : m_toSchedule) {
|
||||
command->Schedule();
|
||||
|
||||
Reference in New Issue
Block a user