20 template <
typename... Args>
23 , m_aggregateCommand{std::make_unique<Command_T>()}
26 std::is_base_of<score::AggregateCommand, Command_T>::value,
27 "MacroCommandDispatcher: Command_T must be AggregateCommand-derived");
30 template <
typename... Args>
32 std::unique_ptr<score::AggregateCommand> cmd, Args&&... args)
34 , m_aggregateCommand{std::move(cmd)}
36 SCORE_ASSERT(m_aggregateCommand);
41 RedoStrategy_T::redo(stack().context(), *cmd);
42 m_aggregateCommand->addCommand(cmd);
47 if(m_aggregateCommand)
49 if(m_aggregateCommand->count() != 0)
51 SendStrategy_T::send(stack(), m_aggregateCommand.release());
54 m_aggregateCommand.reset();
60 if(m_aggregateCommand)
62 m_aggregateCommand->undo(stack().context());
63 m_aggregateCommand.reset();
67 auto command()
const {
return m_aggregateCommand.get(); }
70 std::unique_ptr<Command_T> m_aggregateCommand;