Boost logo

Boost Users :

From: Benjamin Lau (blwy10v_at_[hidden])
Date: 2006-10-06 11:37:31


> I would definitely be interested in such a framework FWIW. Also happy to test!

Yay! That's nice to note. I'm actually in the midst of designing an
undo/redo framework and was thinking of submitting it to Boost once it
is done. It's fairly simple in design and only needs 1 source file!

Basically, it works like this:

1. Create 3 functions (or function-like entities) which perform an
action, undo this action, and redo the action, based on a single
change-parameter (any arbitrary data type of the user's choice T).
2. Create an undo redo stack
3. Pass the 3 functions and the undo redo stack to a free function
that will return a boost:: function that when called with the
change-parameter, will perform the specified action, push the undo and
redo functions and the change-parameter onto the undo stack of the
undo redo stack object.
4. Undo and redo actions can hence be performed by calling undo/redo
member functions on the undo redo stack object

This is basically how I intend it to work, but I don't know if it will
suit any of your means, since I don't want to over-generalize, but
neither do I want to be overly specific. Any comments?

Thanks for showing interest.

Benjamin Lau

P/s I may disappear off spontaneously because my exams are going to
begin soon. But rest assured I will be a responsible OP and respond to
this thread when I can.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net