mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-12 18:59:59 +01:00
Snapshots in Action manager
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
#ifndef ACTIONMANAGER_H
|
||||
#define ACTIONMANAGER_H
|
||||
|
||||
|
||||
#include <list>
|
||||
#include <atomic>
|
||||
|
||||
#include <tinyxml2.h>
|
||||
|
||||
|
||||
|
||||
class Action
|
||||
{
|
||||
// Private Constructor
|
||||
@@ -23,25 +25,36 @@ public:
|
||||
}
|
||||
|
||||
void store(const std::string &label);
|
||||
|
||||
void clear();
|
||||
void undo();
|
||||
void redo();
|
||||
void stepTo(uint target);
|
||||
|
||||
inline uint current() const { return step_; }
|
||||
inline uint max() const { return max_step_; }
|
||||
|
||||
inline uint current() const { return history_step_; }
|
||||
inline uint max() const { return history_max_step_; }
|
||||
std::string label(uint s) const;
|
||||
|
||||
void snapshot(const std::string &label);
|
||||
|
||||
inline std::list<uint64_t> snapshots() const { return snapshots_; }
|
||||
std::string label(uint64_t s) const;
|
||||
void restore(uint64_t snapshotid);
|
||||
void remove (uint64_t snapshotid);
|
||||
void setLabel (uint64_t snapshotid, const std::string &label);
|
||||
|
||||
private:
|
||||
|
||||
void restore(uint target);
|
||||
|
||||
tinyxml2::XMLDocument xmlDoc_;
|
||||
uint step_;
|
||||
uint max_step_;
|
||||
tinyxml2::XMLDocument history_doc_;
|
||||
uint history_step_;
|
||||
uint history_max_step_;
|
||||
std::atomic<bool> locked_;
|
||||
|
||||
|
||||
tinyxml2::XMLDocument snapshots_doc_;
|
||||
std::list<uint64_t> snapshots_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user