Files
BionxControl/nodes/services/ntxcmdlist.h

42 lines
784 B
C
Raw Normal View History

2026-04-02 15:15:28 +02:00
#ifndef NTX_CMDLIST_H
#define NTX_CMDLIST_H
#include <ntxicommand.h>
#include <vector>
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<NtxCommandUPtr> m_commands;
size_t m_executedCount;
void rollback(size_t upToIndex);
};
} // namespace ntx
#endif // NTX_CMDLIST_H