Changeset b56114


Ignore:
Timestamp:
Feb 4, 2015, 9:31:33 PM (10 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:
917300
Parents:
2e7afe
git-author:
Frederik Heber <heber@…> (01/23/15 19:43:55)
git-committer:
Frederik Heber <heber@…> (02/04/15 21:31:33)
Message:

FIX: Action..::outputAsPython now accesses parameters via getUnvalidated().

  • added Value::getUnvalidated() and Parameter::getUnvalidated() for access at store-session.
  • this fixes a bug when OutputAsAction had been used whose filename would no longer be valid as the file now exists. This would cause an assertion and the whole OutputAsAction would fail.
Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/Action_impl_pre.hpp

    r2e7afe rb56114  
    175175    << "\"" << toPythonString(params. \
    176176        BOOST_PP_SEQ_ELEM(n, paramreferences) \
    177         .get()) \
     177        .getUnvalidated()) \
    178178    << "\"";
    179179
  • src/Parameters/Parameter.hpp

    r2e7afe rb56114  
    5353  bool isValid(const T &_value) const throw(ParameterValidatorException);
    5454  const T & get() const throw(ParameterValueException);
     55  const T & getUnvalidated() const throw(ParameterValueException);
    5556  void set(const T & _value) throw(ParameterValueException);
    5657  bool isSet() const
  • src/Parameters/Parameter_impl.hpp

    r2e7afe rb56114  
    186186}
    187187
     188
     189/** Catch call to value.getUnvalidated() to add exception information.
     190 *
     191 * @return parameter value as string
     192 */
     193template<typename T>
     194inline const T & Parameter<T>::getUnvalidated() const throw(ParameterValueException)
     195{
     196  try {
     197    return value.getUnvalidated();
     198  } catch(ParameterException &e) {
     199    e << ParameterName(ParameterInterface::getName());
     200    throw;
     201  }
     202}
    188203
    189204/** Catch call to value.get() to add exception information.
  • src/Parameters/Value.hpp

    r2e7afe rb56114  
    7777  // functions for ValueInterface
    7878  bool isValid(const T &_value) const throw(ParameterValidatorException);
     79  const T & getUnvalidated() const throw(ParameterValueException);
    7980  const T & get() const throw(ParameterValueException);
    8081  void set(const T & _value) throw(ParameterException);
  • src/Parameters/ValueInterface.hpp

    r2e7afe rb56114  
    3131  virtual bool isValid(const T & _value) const throw(ParameterValidatorException)=0;
    3232  virtual const T & get() const throw(ParameterValueException)=0;
     33  virtual const T & getUnvalidated() const throw(ParameterValueException)=0;
    3334  virtual void set(const T & _value) throw(ParameterException)=0;
    3435  virtual bool isSet() const=0;
  • src/Parameters/Value_impl.hpp

    r2e7afe rb56114  
    120120{
    121121  if (!isValid(value)) throw ParameterValueException();
     122  if (!ValueSet) throw ParameterValueException();
     123  return value;
     124}
     125
     126/** Getter of value without any validation
     127 *
     128 * @return value
     129 */
     130template <class T>
     131inline const T & Value<T>::getUnvalidated() const throw(ParameterValueException)
     132{
    122133  if (!ValueSet) throw ParameterValueException();
    123134  return value;
Note: See TracChangeset for help on using the changeset viewer.