[commands] Add owning overload to ProxyScheduleCommand (#4405)

This commit is contained in:
Starlight220
2022-09-14 04:33:19 +03:00
committed by GitHub
parent cb33bd71df
commit 9ae38eaa7c
3 changed files with 56 additions and 5 deletions

View File

@@ -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();