Changeset b2c302 for src/Actions/Action.hpp
- Timestamp:
- Apr 11, 2012, 4:56:55 PM (14 years ago)
- 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, Candidate_v1.7.0, 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:
- e44956
- Parents:
- be21fa
- git-author:
- Frederik Heber <heber@…> (03/16/12 12:29:01)
- git-committer:
- Frederik Heber <heber@…> (04/11/12 16:56:55)
- File:
-
- 1 edited
-
src/Actions/Action.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Action.hpp
rbe21fa rb2c302 36 36 namespace MoleCuilder { 37 37 38 /** 39 * Base class for all actions. 38 /** Actions are Command patterns to allow for undoing and redoing. 39 * 40 * Each specific Action derives from this class to implement a certain functionality. 40 41 * 41 42 * Actions describe something that has to be done. 42 * Actions can be passed around, stored, performed and undone (Command-Pattern). 43 * Actions can be passed around, stored, performed and undone (Command-Pattern: 44 * http://en.wikipedia.org/wiki/Command_pattern). 45 * 46 * Unique to each Action is its ActionTrait, i.e. the options it requires 47 * to perform a certain function. E.g. in order to execute a "add atom" Action 48 * we need to know a position and an element. These options have certain 49 * properties, see \ref OptionTrait and \ref ActionTrait wherein these are stored. 50 * Essentially, each option is stored as an \ref OptionTrait instance and 51 * contains the token, default value, a description, the type, ... 52 * 53 * ActionTrait itself is also an OptionTrait because the command token may actually 54 * coincide with an option-token. E.g. this allows "...--add-atom 3" to mean 55 * both execute the action under token "add-atom" and that the option "add-atom" 56 * (the new atom's \ref element number) should contain 3. 57 * 58 * \ref ActionTrait contains a map of all associated options. With this in the cstor 59 * we register not only the Action with the \ref ActionRegistry but also each of 60 * its \link options OptionTrait \endlink with the \ref OptionRegistry. 61 * 62 * The token of the option is unique, but two Action's may share the same token if: 63 * -# they have the same default value 64 * -# they have the same type 65 * 66 * This requirement is easy because if you need to store some option of another 67 * type, simply think of a new suitable name for it. 68 * 69 * The actual value, i.e. "3" in the "add-atom" example, is taken from the 70 * ValueStorage, see \ref Dialog for how this is possible. 71 * 72 * \note There is a unit test that checks on the consistency of all registered 73 * options, also in "--enable-debug"-mode assertions will check that an option 74 * has not been registered before under another type. 75 * 43 76 */ 44 77 class Action
Note:
See TracChangeset
for help on using the changeset viewer.
