- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/Actions/CmdAction/FastParsingAction.cpp ¶
r7e37a3 rbf3817 5 5 * Author: heber 6 6 */ 7 8 // include config.h 9 #ifdef HAVE_CONFIG_H 10 #include <config.h> 11 #endif 7 12 8 13 #include "Helpers/MemDebug.hpp" … … 28 33 class CommandLineFastParsingState : public ActionState { 29 34 public: 30 CommandLineFastParsingState(const bool _oldvalue, const bool _newvalue) : 31 oldvalue(_oldvalue), 32 newvalue(_newvalue) 35 CommandLineFastParsingState(bool _bool) : 36 boolean(_bool) 33 37 {} 34 bool oldvalue; 35 bool newvalue; 38 bool boolean; 36 39 }; 37 40 … … 60 63 61 64 Action::state_ptr CommandLineFastParsingAction::performCall() { 65 62 66 config *configuration = World::getInstance().getConfig(); 63 bool oldvalue = configuration->FastParsing; 64 bool newvalue; 65 ValueStorage::getInstance().queryCurrentValue(NAME, newvalue); 66 configuration->FastParsing = newvalue; 67 ValueStorage::getInstance().queryCurrentValue(NAME, configuration->FastParsing); 67 68 if (configuration->FastParsing) 68 69 DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl); 69 70 else 70 71 DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl); 71 return Action::s tate_ptr(new CommandLineFastParsingState(oldvalue, newvalue));72 return Action::success; 72 73 } 73 74 … … 76 77 77 78 config *configuration = World::getInstance().getConfig(); 78 configuration->FastParsing = state->oldvalue; 79 if (configuration->FastParsing) 80 DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl); 81 else 82 DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl); 79 configuration->FastParsing = state->boolean; 83 80 84 return Action::state_ptr( _state);81 return Action::state_ptr(new CommandLineFastParsingState(!state->boolean)); 85 82 } 86 83 87 84 Action::state_ptr CommandLineFastParsingAction::performRedo(Action::state_ptr _state){ 88 CommandLineFastParsingState *state = assert_cast<CommandLineFastParsingState*>(_state.get()); 89 90 config *configuration = World::getInstance().getConfig(); 91 configuration->FastParsing = state->newvalue; 92 if (configuration->FastParsing) 93 DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl); 94 else 95 DoLog(0) && (Log() << Verbose(0) << "I will parse trajectories." << endl); 96 97 return Action::state_ptr(_state); 85 return performUndo(_state); 98 86 } 99 87
Note:
See TracChangeset
for help on using the changeset viewer.