|
Last change
on this file since 9ef76a was 3e8325, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
|
Added a central registry that allows access to actions by name.
|
-
Property mode
set to
100644
|
|
File size:
659 bytes
|
| Rev | Line | |
|---|
| [d20ed5] | 1 | /*
|
|---|
| 2 | * MethodAction.h
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Dec 11, 2009
|
|---|
| 5 | * Author: crueger
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef METHODACTION_H_
|
|---|
| 9 | #define METHODACTION_H_
|
|---|
| 10 |
|
|---|
| 11 | #include <boost/function.hpp>
|
|---|
| [3e8325] | 12 | #include <string>
|
|---|
| [d20ed5] | 13 |
|
|---|
| 14 | #include "Actions/Action.hpp"
|
|---|
| 15 |
|
|---|
| [da09909] | 16 | /**
|
|---|
| 17 | * Wrapper class that allows the construction of Actions from any kind of Method
|
|---|
| 18 | */
|
|---|
| [d20ed5] | 19 | class MethodAction : public Action
|
|---|
| 20 | {
|
|---|
| 21 | public:
|
|---|
| [3e8325] | 22 | MethodAction(std::string _name,boost::function<void()> _executeMethod,bool _doRegister=true);
|
|---|
| [d20ed5] | 23 | virtual ~MethodAction();
|
|---|
| 24 |
|
|---|
| 25 | virtual void call();
|
|---|
| 26 | virtual void undo();
|
|---|
| 27 | virtual bool canUndo();
|
|---|
| 28 |
|
|---|
| [da09909] | 29 | boost::function<void()> executeMethod; //!< this stores the method to be called
|
|---|
| [d20ed5] | 30 |
|
|---|
| 31 |
|
|---|
| 32 | };
|
|---|
| 33 |
|
|---|
| 34 | #endif /* METHODACTION_H_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.