Ignore:
Timestamp:
Sep 19, 2013, 8:23:52 PM (12 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
6367dd
Parents:
f92ef3
git-author:
Frederik Heber <heber@…> (08/19/13 19:04:10)
git-committer:
Frederik Heber <heber@…> (09/19/13 20:23:52)
Message:

ActionState extracted into own header file, rename Action::state_ptr -> ActionState::ptr.

Location:
src/Actions/WorldAction
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/WorldAction/AddEmptyBoundaryAction.cpp

    rf92ef3 rb5b01e  
    6060#include "Action_impl_pre.hpp"
    6161/** =========== define the function ====================== */
    62 Action::state_ptr WorldAddEmptyBoundaryAction::performCall() {
     62ActionState::ptr WorldAddEmptyBoundaryAction::performCall() {
    6363  Vector Min;
    6464  Vector Max;
     
    115115            );
    116116
    117     return Action::state_ptr(UndoState);
     117    return ActionState::ptr(UndoState);
    118118  } else {
    119119    ELOG(2, "There must be atoms present for AddingEmptyBoundary.");
     
    122122}
    123123
    124 Action::state_ptr WorldAddEmptyBoundaryAction::performUndo(Action::state_ptr _state) {
     124ActionState::ptr WorldAddEmptyBoundaryAction::performUndo(ActionState::ptr _state) {
    125125  WorldAddEmptyBoundaryState *state = assert_cast<WorldAddEmptyBoundaryState*>(_state.get());
    126126
     
    142142    *(*AtomRunner) += state->Min - state->params.boundary.get();
    143143
    144   return Action::state_ptr(_state);
     144  return ActionState::ptr(_state);
    145145}
    146146
    147 Action::state_ptr WorldAddEmptyBoundaryAction::performRedo(Action::state_ptr _state){
     147ActionState::ptr WorldAddEmptyBoundaryAction::performRedo(ActionState::ptr _state){
    148148  WorldAddEmptyBoundaryState *state = assert_cast<WorldAddEmptyBoundaryState*>(_state.get());
    149149
     
    160160    *(*AtomRunner) -= state->Min - state->params.boundary.get();
    161161
    162   return Action::state_ptr(_state);
     162  return ActionState::ptr(_state);
    163163}
    164164
  • src/Actions/WorldAction/BoundInBoxAction.cpp

    rf92ef3 rb5b01e  
    5353#include "Action_impl_pre.hpp"
    5454/** =========== define the function ====================== */
    55 Action::state_ptr WorldBoundInBoxAction::performCall() {
     55ActionState::ptr WorldBoundInBoxAction::performCall() {
    5656  // create undo state
    5757  std::vector< boost::shared_ptr<Vector> > OldPositions;
     
    7676    (*MolRunner)->BoundInBox();
    7777  }
    78   return Action::state_ptr(undoState);
     78  return ActionState::ptr(undoState);
    7979}
    8080
    81 Action::state_ptr WorldBoundInBoxAction::performUndo(Action::state_ptr _state) {
     81ActionState::ptr WorldBoundInBoxAction::performUndo(ActionState::ptr _state) {
    8282  WorldBoundInBoxState *state = assert_cast<WorldBoundInBoxState*>(_state.get());
    8383
     
    9797  }
    9898
    99   return Action::state_ptr(_state);
     99  return ActionState::ptr(_state);
    100100}
    101101
    102 Action::state_ptr WorldBoundInBoxAction::performRedo(Action::state_ptr _state){
     102ActionState::ptr WorldBoundInBoxAction::performRedo(ActionState::ptr _state){
    103103//  WorldBoundInBoxState *state = assert_cast<WorldBoundInBoxState*>(_state.get());
    104104
     
    111111  }
    112112
    113   return Action::state_ptr(_state);
     113  return ActionState::ptr(_state);
    114114}
    115115
  • src/Actions/WorldAction/CenterInBoxAction.cpp

    rf92ef3 rb5b01e  
    6161#include "Action_impl_pre.hpp"
    6262/** =========== define the function ====================== */
    63 Action::state_ptr WorldCenterInBoxAction::performCall() {
     63ActionState::ptr WorldCenterInBoxAction::performCall() {
    6464  // create undo state
    6565  std::stringstream undostream;
     
    102102          );
    103103
    104   return Action::state_ptr(UndoState);
     104  return ActionState::ptr(UndoState);
    105105}
    106106
    107 Action::state_ptr WorldCenterInBoxAction::performUndo(Action::state_ptr _state) {
     107ActionState::ptr WorldCenterInBoxAction::performUndo(ActionState::ptr _state) {
    108108  WorldCenterInBoxState *state = assert_cast<WorldCenterInBoxState*>(_state.get());
    109109
     
    133133  LOG(0, "Box domain restored to " << World::getInstance().getDomain().getM());
    134134
    135   return Action::state_ptr(_state);
     135  return ActionState::ptr(_state);
    136136}
    137137
    138 Action::state_ptr WorldCenterInBoxAction::performRedo(Action::state_ptr _state){
     138ActionState::ptr WorldCenterInBoxAction::performRedo(ActionState::ptr _state){
    139139  WorldCenterInBoxState *state = assert_cast<WorldCenterInBoxState*>(_state.get());
    140140
     
    151151  LOG(0, "Box domain is again " << World::getInstance().getDomain().getM());
    152152
    153   return Action::state_ptr(_state);
     153  return ActionState::ptr(_state);
    154154}
    155155
  • src/Actions/WorldAction/CenterOnEdgeAction.cpp

    rf92ef3 rb5b01e  
    6060#include "Action_impl_pre.hpp"
    6161/** =========== define the function ====================== */
    62 Action::state_ptr WorldCenterOnEdgeAction::performCall() {
     62ActionState::ptr WorldCenterOnEdgeAction::performCall() {
    6363  Vector Min;
    6464  Vector Max;
     
    115115          );
    116116
    117   return Action::state_ptr(UndoState);
     117  return ActionState::ptr(UndoState);
    118118}
    119119
    120 Action::state_ptr WorldCenterOnEdgeAction::performUndo(Action::state_ptr _state) {
     120ActionState::ptr WorldCenterOnEdgeAction::performUndo(ActionState::ptr _state) {
    121121  WorldCenterOnEdgeState *state = assert_cast<WorldCenterOnEdgeState*>(_state.get());
    122122
     
    138138  LOG(0, "Box domain restored to " << World::getInstance().getDomain().getM());
    139139
    140   return Action::state_ptr(_state);
     140  return ActionState::ptr(_state);
    141141}
    142142
    143 Action::state_ptr WorldCenterOnEdgeAction::performRedo(Action::state_ptr _state){
     143ActionState::ptr WorldCenterOnEdgeAction::performRedo(ActionState::ptr _state){
    144144  WorldCenterOnEdgeState *state = assert_cast<WorldCenterOnEdgeState*>(_state.get());
    145145
     
    162162  LOG(0, "Box domain is again " << World::getInstance().getDomain().getM());
    163163
    164   return Action::state_ptr(_state);
     164  return ActionState::ptr(_state);
    165165}
    166166
  • src/Actions/WorldAction/ChangeBoxAction.cpp

    rf92ef3 rb5b01e  
    5858#include "Action_impl_pre.hpp"
    5959/** =========== define the function ====================== */
    60 Action::state_ptr WorldChangeBoxAction::performCall() {
     60ActionState::ptr WorldChangeBoxAction::performCall() {
    6161  // create undo state
    6262  std::stringstream undostream;
     
    7777          );
    7878
    79   return Action::state_ptr(UndoState);
     79  return ActionState::ptr(UndoState);
    8080}
    8181
    82 Action::state_ptr WorldChangeBoxAction::performUndo(Action::state_ptr _state) {
     82ActionState::ptr WorldChangeBoxAction::performUndo(ActionState::ptr _state) {
    8383  WorldChangeBoxState *state = assert_cast<WorldChangeBoxState*>(_state.get());
    8484
     
    9393  LOG(0, "Box domain restored to " << World::getInstance().getDomain().getM());
    9494
    95   return Action::state_ptr(_state);
     95  return ActionState::ptr(_state);
    9696}
    9797
    98 Action::state_ptr WorldChangeBoxAction::performRedo(Action::state_ptr _state){
     98ActionState::ptr WorldChangeBoxAction::performRedo(ActionState::ptr _state){
    9999  World::getInstance().setDomain(params.cell_size.get()); // this is needed as only this function is OBSERVEd.
    100100
     
    102102  LOG(0, "Box domain is again " << World::getInstance().getDomain().getM());
    103103
    104   return Action::state_ptr(_state);
     104  return ActionState::ptr(_state);
    105105}
    106106
  • src/Actions/WorldAction/InputAction.cpp

    rf92ef3 rb5b01e  
    5555#include "Action_impl_pre.hpp"
    5656/** =========== define the function ====================== */
    57 Action::state_ptr WorldInputAction::performCall() {
     57ActionState::ptr WorldInputAction::performCall() {
    5858//  MoleculeListClass *molecules = World::getInstance().getMolecules();
    5959//  molecule *mol = NULL;
     
    100100}
    101101
    102 Action::state_ptr WorldInputAction::performUndo(Action::state_ptr _state) {
     102ActionState::ptr WorldInputAction::performUndo(ActionState::ptr _state) {
    103103//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
    104104
     
    107107//  state->mol->setName(state->lastName);
    108108//
    109 //  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
     109//  return ActionState::ptr(new ParserLoadXyzState(state->mol,newName));
    110110}
    111111
    112 Action::state_ptr WorldInputAction::performRedo(Action::state_ptr _state){
     112ActionState::ptr WorldInputAction::performRedo(ActionState::ptr _state){
    113113  return Action::failure;
    114114}
  • src/Actions/WorldAction/OutputAction.cpp

    rf92ef3 rb5b01e  
    5454#include "Action_impl_pre.hpp"
    5555/** =========== define the function ====================== */
    56 Action::state_ptr WorldOutputAction::performCall() {
     56ActionState::ptr WorldOutputAction::performCall() {
    5757  LOG(1, "Storing world to input file.");
    5858
     
    7070}
    7171
    72 Action::state_ptr WorldOutputAction::performUndo(Action::state_ptr _state) {
     72ActionState::ptr WorldOutputAction::performUndo(ActionState::ptr _state) {
    7373//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
    7474
     
    7777//  state->mol->setName(state->lastName);
    7878//
    79 //  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
     79//  return ActionState::ptr(new ParserLoadXyzState(state->mol,newName));
    8080}
    8181
    82 Action::state_ptr WorldOutputAction::performRedo(Action::state_ptr _state){
     82ActionState::ptr WorldOutputAction::performRedo(ActionState::ptr _state){
    8383  return Action::failure;
    8484}
  • src/Actions/WorldAction/OutputAsAction.cpp

    rf92ef3 rb5b01e  
    5353#include "Action_impl_pre.hpp"
    5454/** =========== define the function ====================== */
    55 Action::state_ptr WorldOutputAsAction::performCall() {
     55ActionState::ptr WorldOutputAsAction::performCall() {
    5656  LOG(1, "Storing world to file " << params.filename.get() << ".");
    5757
     
    8282}
    8383
    84 Action::state_ptr WorldOutputAsAction::performUndo(Action::state_ptr _state) {
     84ActionState::ptr WorldOutputAsAction::performUndo(ActionState::ptr _state) {
    8585//  ParserLoadXyzState *state = assert_cast<ParserLoadXyzState*>(_state.get());
    8686
     
    8989//  state->mol->setName(state->lastName);
    9090//
    91 //  return Action::state_ptr(new ParserLoadXyzState(state->mol,newName));
     91//  return ActionState::ptr(new ParserLoadXyzState(state->mol,newName));
    9292}
    9393
    94 Action::state_ptr WorldOutputAsAction::performRedo(Action::state_ptr _state){
     94ActionState::ptr WorldOutputAsAction::performRedo(ActionState::ptr _state){
    9595  return Action::failure;
    9696}
  • src/Actions/WorldAction/RepeatBoxAction.cpp

    rf92ef3 rb5b01e  
    113113}
    114114
    115 Action::state_ptr WorldRepeatBoxAction::performCall() {
     115ActionState::ptr WorldRepeatBoxAction::performCall() {
    116116  std::vector<molecule *> AllMolecules;
    117117  DoLog(0) && (Log() << Verbose(0) << "Using all molecules." << endl);
     
    132132  LOG(0, "Box domain is now " << World::getInstance().getDomain().getM());
    133133
    134   return Action::state_ptr(undostate);
     134  return ActionState::ptr(undostate);
    135135}
    136136
    137 Action::state_ptr WorldRepeatBoxAction::performUndo(Action::state_ptr _state) {
     137ActionState::ptr WorldRepeatBoxAction::performUndo(ActionState::ptr _state) {
    138138  WorldRepeatBoxState *state = assert_cast<WorldRepeatBoxState*>(_state.get());
    139139  MoleculeListClass *molecules = World::getInstance().getMolecules();
     
    158158  LOG(0, "Box domain restored to " << World::getInstance().getDomain().getM());
    159159
    160   return Action::state_ptr(_state);
     160  return ActionState::ptr(_state);
    161161}
    162162
    163 Action::state_ptr WorldRepeatBoxAction::performRedo(Action::state_ptr _state){
     163ActionState::ptr WorldRepeatBoxAction::performRedo(ActionState::ptr _state){
    164164  WorldRepeatBoxState *state = assert_cast<WorldRepeatBoxState*>(_state.get());
    165165
     
    174174  LOG(0, "Box domain is again " << World::getInstance().getDomain().getM());
    175175
    176   return Action::state_ptr(_state);
     176  return ActionState::ptr(_state);
    177177}
    178178
  • src/Actions/WorldAction/ScaleBoxAction.cpp

    rf92ef3 rb5b01e  
    5454#include "Action_impl_pre.hpp"
    5555/** =========== define the function ====================== */
    56 Action::state_ptr WorldScaleBoxAction::performCall() {
     56ActionState::ptr WorldScaleBoxAction::performCall() {
    5757  double x[NDIM];
    5858
     
    8080  WorldScaleBoxState *UndoState = new WorldScaleBoxState(params);
    8181
    82   return Action::state_ptr(UndoState);
     82  return ActionState::ptr(UndoState);
    8383}
    8484
    85 Action::state_ptr WorldScaleBoxAction::performUndo(Action::state_ptr _state) {
     85ActionState::ptr WorldScaleBoxAction::performUndo(ActionState::ptr _state) {
    8686  WorldScaleBoxState *state = assert_cast<WorldScaleBoxState*>(_state.get());
    8787
     
    107107  LOG(0, "Box domain restored to " << World::getInstance().getDomain().getM());
    108108
    109   return Action::state_ptr(_state);
     109  return ActionState::ptr(_state);
    110110}
    111111
    112 Action::state_ptr WorldScaleBoxAction::performRedo(Action::state_ptr _state){
     112ActionState::ptr WorldScaleBoxAction::performRedo(ActionState::ptr _state){
    113113  WorldScaleBoxState *state = assert_cast<WorldScaleBoxState*>(_state.get());
    114114
     
    134134  LOG(0, "Box domain is again " << World::getInstance().getDomain().getM());
    135135
    136   return Action::state_ptr(_state);
     136  return ActionState::ptr(_state);
    137137}
    138138
  • src/Actions/WorldAction/SetBoundaryConditionsAction.cpp

    rf92ef3 rb5b01e  
    5454#include "Action_impl_pre.hpp"
    5555/** =========== define the function ====================== */
    56 Action::state_ptr WorldSetBoundaryConditionsAction::performCall() {
     56ActionState::ptr WorldSetBoundaryConditionsAction::performCall() {
    5757  // gather undo information
    5858  std::stringstream undostream;
     
    7070
    7171  LOG(0, "STATUS: Boundary conditions are now " << World::getInstance().getDomain().getConditionNames() << ".");
    72   return Action::state_ptr(UndoState);
     72  return ActionState::ptr(UndoState);
    7373}
    7474
    75 Action::state_ptr WorldSetBoundaryConditionsAction::performUndo(Action::state_ptr _state) {
     75ActionState::ptr WorldSetBoundaryConditionsAction::performUndo(ActionState::ptr _state) {
    7676  WorldSetBoundaryConditionsState *state = assert_cast<WorldSetBoundaryConditionsState*>(_state.get());
    7777
     
    8080
    8181  LOG(0, "STATUS: Boundary conditions are set back to " << World::getInstance().getDomain().getConditionNames() << ".");
    82   return Action::state_ptr(_state);
     82  return ActionState::ptr(_state);
    8383}
    8484
    85 Action::state_ptr WorldSetBoundaryConditionsAction::performRedo(Action::state_ptr _state){
     85ActionState::ptr WorldSetBoundaryConditionsAction::performRedo(ActionState::ptr _state){
    8686  WorldSetBoundaryConditionsState *state = assert_cast<WorldSetBoundaryConditionsState*>(_state.get());
    8787
     
    9090
    9191  LOG(0, "STATUS: Boundary conditions are again " << World::getInstance().getDomain().getConditionNames() << ".");
    92   return Action::state_ptr(_state);
     92  return ActionState::ptr(_state);
    9393}
    9494
  • src/Actions/WorldAction/SetDefaultNameAction.cpp

    rf92ef3 rb5b01e  
    5050#include "Action_impl_pre.hpp"
    5151/** =========== define the function ====================== */
    52 Action::state_ptr WorldSetDefaultNameAction::performCall() {
     52ActionState::ptr WorldSetDefaultNameAction::performCall() {
    5353  string Worldsdefaultname;
    5454  Worldsdefaultname = World::getInstance().getDefaultName();
     
    5757  World::getInstance().setDefaultName(params.newname.get());
    5858  LOG(0, "Default name of new molecules set to " << World::getInstance().getDefaultName() << ".");
    59   return Action::state_ptr(UndoState);
     59  return ActionState::ptr(UndoState);
    6060}
    6161
    62 Action::state_ptr WorldSetDefaultNameAction::performUndo(Action::state_ptr _state) {
     62ActionState::ptr WorldSetDefaultNameAction::performUndo(ActionState::ptr _state) {
    6363  WorldSetDefaultNameState *state = assert_cast<WorldSetDefaultNameState*>(_state.get());
    6464
     
    6666  LOG(0, "Default name of new molecules set to " << World::getInstance().getDefaultName() << ".");
    6767
    68   return Action::state_ptr(_state);
     68  return ActionState::ptr(_state);
    6969}
    7070
    71 Action::state_ptr WorldSetDefaultNameAction::performRedo(Action::state_ptr _state){
     71ActionState::ptr WorldSetDefaultNameAction::performRedo(ActionState::ptr _state){
    7272  WorldSetDefaultNameState *state = assert_cast<WorldSetDefaultNameState*>(_state.get());
    7373
     
    7575  LOG(0, "Default name of new molecules set to " << World::getInstance().getDefaultName() << ".");
    7676
    77   return Action::state_ptr(_state);
     77  return ActionState::ptr(_state);
    7878}
    7979
  • src/Actions/WorldAction/SetWorldTimeAction.cpp

    rf92ef3 rb5b01e  
    5151#include "Action_impl_pre.hpp"
    5252/** =========== define the function ====================== */
    53 Action::state_ptr WorldSetWorldTimeAction::performCall() {
     53ActionState::ptr WorldSetWorldTimeAction::performCall() {
    5454  // create undo state
    5555  int oldtime;
     
    5959  World::getInstance().setTime(params.newtime.get());
    6060  LOG(0, "Current time step is now: " << WorldTime::getTime() << ".");
    61   return Action::state_ptr(UndoState);
     61  return ActionState::ptr(UndoState);
    6262}
    6363
    64 Action::state_ptr WorldSetWorldTimeAction::performUndo(Action::state_ptr _state) {
     64ActionState::ptr WorldSetWorldTimeAction::performUndo(ActionState::ptr _state) {
    6565  WorldSetWorldTimeState *state = assert_cast<WorldSetWorldTimeState*>(_state.get());
    6666
     
    6868  LOG(0, "Current time step is now again: " << WorldTime::getTime() << ".");
    6969
    70   return Action::state_ptr(_state);
     70  return ActionState::ptr(_state);
    7171}
    7272
    73 Action::state_ptr WorldSetWorldTimeAction::performRedo(Action::state_ptr _state){
     73ActionState::ptr WorldSetWorldTimeAction::performRedo(ActionState::ptr _state){
    7474  WorldSetWorldTimeState *state = assert_cast<WorldSetWorldTimeState*>(_state.get());
    7575
     
    7777  LOG(0, "Current time step is now: " << WorldTime::getTime() << ".");
    7878
    79   return Action::state_ptr(_state);
     79  return ActionState::ptr(_state);
    8080}
    8181
Note: See TracChangeset for help on using the changeset viewer.