source: molecuilder/src/Actions/MethodAction.hpp@ 2e06c4

Last change on this file since 2e06c4 was 521e29, checked in by Tillmann Crueger <crueger@…>, 15 years ago

Switched type of pointer used for ActionStates

  • Property mode set to 100644
File size: 813 bytes
Line 
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>
12#include <string>
13
14#include "Actions/Action.hpp"
15
16/**
17 * Wrapper class that allows the construction of Actions from any kind of Method
18 */
19class MethodAction : public Action
20{
21public:
22 MethodAction(std::string _name,boost::function<void()> _executeMethod,bool _doRegister=true);
23 virtual ~MethodAction();
24 virtual bool canUndo();
25 virtual bool shouldUndo();
26
27private:
28 virtual Action::state_ptr performCall();
29 virtual Action::state_ptr performUndo(Action::state_ptr);
30 virtual Action::state_ptr performRedo(Action::state_ptr);
31
32
33 boost::function<void()> executeMethod; //!< this stores the method to be called
34};
35
36#endif /* METHODACTION_H_ */
Note: See TracBrowser for help on using the repository browser.