|
Last change
on this file since 0012e6 was 0012e6, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
|
Added methods that allow bookkeeping of actions for undo/redo methods
|
-
Property mode
set to
100644
|
|
File size:
868 bytes
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * ErrorAction.cpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Jan 5, 2010
|
|---|
| 5 | * Author: crueger
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #include <iostream>
|
|---|
| 9 |
|
|---|
| 10 | #include "Actions/ErrorAction.hpp"
|
|---|
| 11 | #include "log.hpp"
|
|---|
| 12 | #include "verbose.hpp"
|
|---|
| 13 | #include "Helpers/Assert.hpp"
|
|---|
| 14 |
|
|---|
| 15 | using namespace std;
|
|---|
| 16 |
|
|---|
| 17 | ErrorAction::ErrorAction(string _name,const char * _errorMsg,bool _doRegister) :
|
|---|
| 18 | Action(_name,_doRegister),
|
|---|
| 19 | errorMsg(_errorMsg)
|
|---|
| 20 | {
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | ErrorAction::~ErrorAction()
|
|---|
| 24 | {
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | ActionState* ErrorAction::performCall() {
|
|---|
| 28 | Log() << Verbose(0) << errorMsg << endl;
|
|---|
| 29 | return Action::success;
|
|---|
| 30 | }
|
|---|
| 31 | ActionState* ErrorAction::performUndo(ActionState*) {
|
|---|
| 32 | ASSERT(0,"Undo called for an ErrorAction");
|
|---|
| 33 | return Action::success;
|
|---|
| 34 | }
|
|---|
| 35 |
|
|---|
| 36 | ActionState* ErrorAction::performRedo(ActionState*) {
|
|---|
| 37 | ASSERT(0,"Redo called for an ErrorAction");
|
|---|
| 38 | return Action::success;
|
|---|
| 39 | }
|
|---|
| 40 |
|
|---|
| 41 | bool ErrorAction::canUndo(){
|
|---|
| 42 | return false;
|
|---|
| 43 | }
|
|---|
| 44 |
|
|---|
| 45 | bool ErrorAction::shouldUndo(){
|
|---|
| 46 | return false;
|
|---|
| 47 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.