21 #ifndef __lib_pbd_memento_command_h__
22 #define __lib_pbd_memento_command_h__
32 #include <sigc++/slot.h>
53 template <
class obj_T>
58 virtual obj_T*
get ()
const = 0;
66 virtual void add_state (
XMLNode *) = 0;
70 template <
class obj_T>
102 template <
class obj_T>
114 : _binder (b), before (a_before), after (a_after)
133 _binder->get()->set_state(*after, Stateful::current_state_version);
139 _binder->get()->set_state(*before, Stateful::current_state_version);
145 if (before && after) {
146 name =
"MementoCommand";
148 name =
"MementoUndoCommand";
150 name =
"MementoRedoCommand";
154 _binder->add_state (node);
156 node->
add_property (
"type_name", _binder->type_name ());
176 #endif // __lib_pbd_memento_h__
SimpleMementoCommandBinder(obj_T &o)
virtual void operator()()=0
MementoCommand(obj_T &a_object, XMLNode *a_before, XMLNode *a_after)
MementoCommand(MementoCommandBinder< obj_T > *b, XMLNode *a_before, XMLNode *a_after)
XMLNode * add_child_copy(const XMLNode &)
MementoCommandBinder< obj_T > * _binder
std::string demangled_name(T const &obj)
#define LIBPBD_TEMPLATE_API
XMLProperty * add_property(const char *name, const std::string &value)
virtual std::string type_name() const
PBD::ScopedConnection _object_death_connection
void add_state(XMLNode *node)
virtual XMLNode & get_state()
const std::string & name() const
PBD::ScopedConnection _binder_death_connection