aboutsummaryrefslogtreecommitdiffhomepage
path: root/undo.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-07 07:22:35 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-07 07:22:35 +0100
commit2ed38e4d01d73d62b29a28d7540ca515f9ff3b09 (patch)
tree58c2c07513946285ca3a514d364aae5cb1ebb4e8 /undo.h
parent8cd29b9b30400e4275f1a65744cd0b3c2669cc98 (diff)
downloadsciteco-2ed38e4d01d73d62b29a28d7540ca515f9ff3b09.tar.gz
expression stack based on THECO's ArithmeticStack
Diffstat (limited to 'undo.h')
-rw-r--r--undo.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/undo.h b/undo.h
index 29ec70f..9c7ac5f 100644
--- a/undo.h
+++ b/undo.h
@@ -58,15 +58,20 @@ public:
}
~UndoStack();
+ inline void
+ push(UndoToken *token)
+ {
+ SLIST_INSERT_HEAD(&head, token, tokens);
+ }
+
void push_msg(unsigned int iMessage,
uptr_t wParam = 0, sptr_t lParam = 0);
template <typename Type>
- void
+ inline void
push_var(Type &variable, Type value)
{
- UndoToken *token = new UndoTokenVariable<Type>(variable, value);
- SLIST_INSERT_HEAD(&head, token, tokens);
+ push(new UndoTokenVariable<Type>(variable, value));
}
template <typename Type>