From 3038d8ce4aa0627847bdcbd8140447fb306ef7fb Mon Sep 17 00:00:00 2001 From: Hans Fugal Date: Wed, 7 Jun 2006 23:08:56 +0000 Subject: [PATCH] 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 --- libs/pbd3/pbd/undo.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/libs/pbd3/pbd/undo.h b/libs/pbd3/pbd/undo.h index f067635ed3..b540179012 100644 --- a/libs/pbd3/pbd/undo.h +++ b/libs/pbd3/pbd/undo.h @@ -24,13 +24,45 @@ #include #include #include +#include #include +#include using std::string; using std::list; typedef sigc::slot UndoAction; +class Serializable; + +class MementoBase +{ +public: + MementoBase(std::string key); + void operator() () { return _slot(); } + XMLNode &serialize(); +protected: + sigc::slot _slot; + std::list _args; +}; + +template +class Memento; + +template <> +class Memento <> : public MementoBase {}; + +template +class Memento : public MementoBase +{ +public: + Memento(std::string key, T1 arg1) : MementoBase(key) + { + _args.push_back(arg1); + _slot = sigc::bind(_slot, arg1); + } +}; + class UndoCommand { public: