Changeset f54cda for src/Actions


Ignore:
Timestamp:
Sep 19, 2013, 8:23:52 PM (11 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:
76096d
Parents:
c5177f
git-author:
Frederik Heber <heber@…> (08/21/13 09:27:08)
git-committer:
Frederik Heber <heber@…> (09/19/13 20:23:52)
Message:

Action::call() is private, replaced by ActionQueue::queueAction().

Location:
src/Actions
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/Action.hpp

    rc5177f rf54cda  
    2929namespace MoleCuilder {
    3030  class ActionHistory;
     31  class ActionQueue;
    3132  class ActionRegistry;
    3233  class ActionSequence;
     
    8384class Action
    8485{
     86  //!> grant ActionQueue access to undo() and redo()
    8587  friend class ActionHistory;
     88  //!> grant ActionQueue access to call()
     89  friend class ActionQueue;
     90  //!> grant ActionRegistry access to cstors (for ActionRegistry::fillRegistry())
    8691  friend class ActionRegistry;
     92  //!> grant ActionSequence access to Action's private stuff
    8793  friend class ActionSequence;
     94  //!> grant all Registry templates access to cstor and dstor (for Registry<T>::cleanup())
    8895  template <typename T> friend class ::Registry;
    8996  //!> TextMenu needs to instantiate some specific Actions, grant access to cstor
     
    112119  virtual ~Action();
    113120
    114 public:
    115121  /**
    116122   * This method is used to call an action. The basic operations for the Action
     
    128134  void call(enum QueryOptions state = Interactive);
    129135
     136public:
    130137  /**
    131138   * This method provides a flag that indicates if an undo mechanism is implemented
  • src/Actions/ActionQueue.cpp

    rc5177f rf54cda  
    6060}
    6161
    62 void ActionQueue::queueAction(const std::string &name)
     62void ActionQueue::queueAction(const std::string &name, enum Action::QueryOptions state)
    6363{
    6464  Action* _action = AR->getActionByName(name);
    6565  queue.push_back(_action);
    66   _action->call();
     66  _action->call(state);
     67}
     68
     69void ActionQueue::queueAction(Action *_action, enum Action::QueryOptions state)
     70{
     71  queue.push_back(_action);
     72  _action->call(state);
    6773}
    6874
  • src/Actions/ActionQueue.hpp

    rc5177f rf54cda  
    1919#include <vector>
    2020
     21#include "Actions/Action.hpp"
    2122#include "Actions/ActionState.hpp"
    2223
    2324namespace MoleCuilder {
    2425
    25 class Action;
    2626class ActionHistory;
    2727class ActionRegistry;
     
    4242  /** Queues the Action with \a name to be called.
    4343   *
     44   * \param name token of Action to queue
     45   * \param state whether Actions needs to be filled via a Dialog or not
    4446   */
    45   void queueAction(const std::string &name);
     47  void queueAction(const std::string &name, enum Action::QueryOptions state = Action::Interactive);
     48
     49  /** Queues the Action with \a name to be called.
     50   *
     51   * \param _action action to add
     52   * \param state whether Actions needs to be filled via a Dialog or not
     53   */
     54  void queueAction(Action *_action, enum Action::QueryOptions state = Action::Interactive);
    4655
    4756  /** Returns the spawned action by token \a name.
  • src/Actions/Action_impl_pre.hpp

    rc5177f rf54cda  
    296296#include BOOST_PP_LOCAL_ITERATE()
    297297#endif
    298   ToCall->call(Action::NonInteractive);
     298  ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive);
    299299};
    300300
     
    313313#include BOOST_PP_LOCAL_ITERATE()
    314314#endif
    315   ToCall->call(MoleCuilder::Action::NonInteractive);
     315  ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive);
    316316};
    317317
  • src/Actions/GraphAction/SubgraphDissectionAction.cpp

    rc5177f rf54cda  
    159159#include BOOST_PP_LOCAL_ITERATE()
    160160#endif
    161   ToCall->call(Action::NonInteractive);
     161  ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive);
    162162};
    163163
     
    176176#include BOOST_PP_LOCAL_ITERATE()
    177177#endif
    178   ToCall->call(MoleCuilder::Action::NonInteractive);
     178  ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive);
    179179};
    180180
  • src/Actions/MakroAction_impl_pre.hpp

    rc5177f rf54cda  
    297297#include BOOST_PP_LOCAL_ITERATE()
    298298#endif
    299   ToCall->call(Action::NonInteractive);
     299  ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive);
    300300};
    301301
     
    314314#include BOOST_PP_LOCAL_ITERATE()
    315315#endif
    316   ToCall->call(MoleCuilder::Action::NonInteractive);
     316  ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive);
    317317};
    318318
  • src/Actions/ManipulateAtomsProcess.hpp

    rc5177f rf54cda  
    2121#include "Descriptors/AtomDescriptor.hpp"
    2222
     23class manipulateAtomsTest;
    2324class World;
    2425
     
    2930class ManipulateAtomsProcess : public Process
    3031{
     32  friend class ::manipulateAtomsTest;
    3133public:
    3234  ManipulateAtomsProcess(boost::function<void(atom*)> _operation, AtomDescriptor descr,const ActionTrait &_trait);
     
    3739
    3840  virtual void doManipulate(World *);
     41
     42private:
     43  /** Wrap function Action::call() to allow manipulateAtomsTest access.
     44   *
     45   */
     46  void call(enum QueryOptions state = Interactive)
     47  { Process::call(state); }
    3948
    4049protected:
  • src/Actions/Reaction_impl_pre.hpp

    rc5177f rf54cda  
    201201#include BOOST_PP_LOCAL_ITERATE()
    202202#endif
    203   ToCall->call(Action::NonInteractive);
    204 
    205   return static_cast<Reaction< RETURNTYPE > *>(ToCall)->getResult();
     203  ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive);
     204  Reaction< RETURNTYPE > * resultaction = static_cast<Reaction< RETURNTYPE > *>(ToCall);
     205  ASSERT( resultaction != NULL,
     206      "  COMMAND - static cast to Reaction type failed.");
     207  ASSERT( resultaction->hasResult (),
     208      " _COMMAND - result is not done yet?");
     209  return resultaction->getResult();
    206210};
    207211
     
    220224#include BOOST_PP_LOCAL_ITERATE()
    221225#endif
    222   ToCall->call(MoleCuilder::Action::NonInteractive);
    223 
    224   return static_cast<Reaction< RETURNTYPE > *>(ToCall)->getResult();
     226  ActionQueue::getInstance().queueAction( ToCall, Action::NonInteractive);
     227  Reaction< RETURNTYPE > * resultaction = static_cast<Reaction< RETURNTYPE > *>(ToCall);
     228  ASSERT( resultaction != NULL,
     229      "  COMMAND - static cast to Reaction type failed.");
     230  ASSERT( resultaction->hasResult (),
     231      " _COMMAND - result is not done yet?");
     232  return resultaction->getResult();
    225233};
    226234
Note: See TracChangeset for help on using the changeset viewer.