13
0

r42@gandalf: fugalh | 2006-06-07 17:08:39 -0600

Memento skeleton. RFC
 Compiles, but obviously somewhat unimplemented.


git-svn-id: svn://localhost/ardour2/branches/undo@572 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Hans Fugal 2006-06-07 23:08:56 +00:00
parent a6d59d589b
commit 3038d8ce4a

View File

@ -24,13 +24,45 @@
#include <string>
#include <list>
#include <sigc++/slot.h>
#include <sigc++/bind.h>
#include <sys/time.h>
#include <pbd/xml++.h>
using std::string;
using std::list;
typedef sigc::slot<void> UndoAction;
class Serializable;
class MementoBase
{
public:
MementoBase(std::string key);
void operator() () { return _slot(); }
XMLNode &serialize();
protected:
sigc::slot<void> _slot;
std::list<Serializable> _args;
};
template <class T1=void, class T2=void, class T3=void, class T4=void>
class Memento;
template <>
class Memento <> : public MementoBase {};
template <class T1>
class Memento <T1> : public MementoBase
{
public:
Memento(std::string key, T1 arg1) : MementoBase(key)
{
_args.push_back(arg1);
_slot = sigc::bind(_slot, arg1);
}
};
class UndoCommand
{
public: