#ifndef NTX_CMDLIST_H #define NTX_CMDLIST_H #include #include namespace ntx { class NtxCmdList : public NtxICommand { public: NtxCmdList(); explicit NtxCmdList(const NtxString& description); ~NtxCmdList() override = default; bool execute() override; bool undo() override; bool canExecute() const override; bool canUndo() const override; NtxString getDescription() const override; void addCommand(NtxCommandUPtr command); void clear(); size_t count() const; bool isEmpty() const; private: std::vector m_commands; size_t m_executedCount; void rollback(size_t upToIndex); }; } // namespace ntx #endif // NTX_CMDLIST_H