- Timestamp:
- Apr 6, 2011, 1:50:42 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, 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:
- 3e2225f
- Parents:
- 882678
- git-author:
- Frederik Heber <heber@…> (04/01/11 23:03:04)
- git-committer:
- Frederik Heber <heber@…> (04/06/11 13:50:42)
- Location:
- src
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Action.cpp
r882678 r336e33 28 28 #include "Actions/OptionRegistry.hpp" 29 29 #include "Actions/OptionTrait.hpp" 30 #include "Exceptions/MissingValueException.hpp"30 //#include "Actions/ValueStorage.hpp" 31 31 #include "UIElements/Dialog.hpp" 32 32 #include "CodePatterns/Assert.hpp" -
src/Actions/ValueStorage.cpp
r882678 r336e33 59 59 if (typeid( atom *) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { 60 60 if (CurrentValueMap.find(name) == CurrentValueMap.end()) 61 throw MissingValueException( __FILE__, __LINE__);61 throw MissingValueException() << ValueStorageOptionName(name); 62 62 atomID = lexical_cast<int>(CurrentValueMap[name].c_str()); 63 63 CurrentValueMap.erase(name); 64 64 } else if (typeid( const atom *) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { 65 65 if (CurrentValueMap.find(name) == CurrentValueMap.end()) 66 throw MissingValueException( __FILE__, __LINE__);66 throw MissingValueException() << ValueStorageOptionName(name); 67 67 atomID = lexical_cast<int>(CurrentValueMap[name].c_str()); 68 68 CurrentValueMap.erase(name); … … 80 80 if (typeid(const element *) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { 81 81 if (CurrentValueMap.find(name) == CurrentValueMap.end()) 82 throw MissingValueException( __FILE__, __LINE__);82 throw MissingValueException() << ValueStorageOptionName(name); 83 83 Z = lexical_cast<int>(CurrentValueMap[name].c_str()); 84 84 CurrentValueMap.erase(name); … … 96 96 if (typeid( const molecule *) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { 97 97 if (CurrentValueMap.find(name) == CurrentValueMap.end()) 98 throw MissingValueException( __FILE__, __LINE__);98 throw MissingValueException() << ValueStorageOptionName(name); 99 99 molID = lexical_cast<int>(CurrentValueMap[name].c_str()); 100 100 CurrentValueMap.erase(name); … … 113 113 if (typeid( Box ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { 114 114 if (CurrentValueMap.find(name) == CurrentValueMap.end()) 115 throw MissingValueException( __FILE__, __LINE__);115 throw MissingValueException() << ValueStorageOptionName(name); 116 116 std::istringstream stream(CurrentValueMap[name]); 117 117 stream >> tmp; … … 197 197 if (typeid( std::vector<const atom *> ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { 198 198 if (CurrentValueMap.find(name) == CurrentValueMap.end()) 199 throw MissingValueException( __FILE__, __LINE__);199 throw MissingValueException() << ValueStorageOptionName(name); 200 200 std::istringstream stream(CurrentValueMap[name]); 201 201 CurrentValueMap.erase(name); … … 228 228 if (typeid( std::vector<const element *> ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { 229 229 if (CurrentValueMap.find(name) == CurrentValueMap.end()) 230 throw MissingValueException( __FILE__, __LINE__);230 throw MissingValueException() << ValueStorageOptionName(name); 231 231 std::istringstream stream(CurrentValueMap[name]); 232 232 CurrentValueMap.erase(name); … … 258 258 if (typeid( std::vector<const molecule *> ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { 259 259 if (CurrentValueMap.find(name) == CurrentValueMap.end()) 260 throw MissingValueException( __FILE__, __LINE__);260 throw MissingValueException() << ValueStorageOptionName(name); 261 261 std::istringstream stream(CurrentValueMap[name]); 262 262 CurrentValueMap.erase(name); … … 287 287 if (typeid( boost::filesystem::path ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { 288 288 if (CurrentValueMap.find(name) == CurrentValueMap.end()) 289 throw MissingValueException( __FILE__, __LINE__);289 throw MissingValueException() << ValueStorageOptionName(name); 290 290 std::istringstream stream(CurrentValueMap[name]); 291 291 CurrentValueMap.erase(name); -
src/Actions/ValueStorage.hpp
r882678 r336e33 27 27 #include "Actions/OptionTrait.hpp" 28 28 #include "Actions/OptionRegistry.hpp" 29 #include "Exceptions/MissingValueException.hpp"30 29 #include "CodePatterns/Assert.hpp" 31 30 #include "CodePatterns/Singleton.hpp" … … 63 62 */ 64 63 struct IllegalTypeException : virtual ValueStorageException { }; 64 65 /** Exception thrown when ValueStorage is missing a requested value. 66 */ 67 struct MissingValueException : virtual ValueStorageException { }; 68 65 69 66 70 class MapOfActionsTest; … … 123 127 if (typeid( T ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { // constructor of type_info is private, hence can only store by ref or ptr 124 128 if (CurrentValueMap.find(name) == CurrentValueMap.end()) 125 throw MissingValueException( __FILE__, __LINE__);129 throw MissingValueException() << ValueStorageOptionName(name); 126 130 _T = lexical_cast<T>(CurrentValueMap[name].c_str()); 127 131 CurrentValueMap.erase(name); … … 138 142 if (typeid( std::vector<T> ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { // constructor of type_info is private, hence can only store by ref or ptr 139 143 if (CurrentValueMap.find(name) == CurrentValueMap.end()) 140 throw MissingValueException( __FILE__, __LINE__);144 throw MissingValueException() << ValueStorageOptionName(name); 141 145 std::istringstream stream(CurrentValueMap[name]); 142 146 CurrentValueMap.erase(name); -
src/Exceptions/Makefile.am
r882678 r336e33 8 8 9 9 EXCEPTIONSOURCE = \ 10 CustomException.cpp \ 11 MissingValueException.cpp 10 CustomException.cpp 12 11 13 12 14 13 EXCEPTIONHEADER = \ 15 CustomException.hpp \ 16 MissingValueException.hpp 14 CustomException.hpp 17 15 18 16
Note:
See TracChangeset
for help on using the changeset viewer.