mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-08 16:59:59 +01:00
int. Deep change in all concerned objects (Node, Source, Shader, etc.). No behavior change, just more robust in duration.
48 lines
882 B
C++
48 lines
882 B
C++
#ifndef ACTIONMANAGER_H
|
|
#define ACTIONMANAGER_H
|
|
|
|
|
|
#include <atomic>
|
|
|
|
#include <tinyxml2.h>
|
|
|
|
class Action
|
|
{
|
|
// Private Constructor
|
|
Action();
|
|
Action(Action const& copy); // Not Implemented
|
|
Action& operator=(Action const& copy); // Not Implemented
|
|
|
|
public:
|
|
|
|
static Action& manager()
|
|
{
|
|
// The only instance
|
|
static Action _instance;
|
|
return _instance;
|
|
}
|
|
|
|
void store(const std::string &label, uint64_t id = -1);
|
|
|
|
void clear();
|
|
void undo();
|
|
void redo();
|
|
void stepTo(uint target);
|
|
|
|
inline uint current() const { return step_; }
|
|
inline uint max() const { return max_step_; }
|
|
|
|
std::string label(uint s) const;
|
|
|
|
private:
|
|
|
|
void restore(uint target, uint64_t id);
|
|
|
|
tinyxml2::XMLDocument xmlDoc_;
|
|
uint step_;
|
|
uint max_step_;
|
|
std::atomic<bool> locked_;
|
|
};
|
|
|
|
#endif // ACTIONMANAGER_H
|