added nodes.
This commit is contained in:
42
nodes/services/ntxcmdlist.h
Normal file
42
nodes/services/ntxcmdlist.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user