Changeset 336e33 for src


Ignore:
Timestamp:
Apr 6, 2011, 1:50:42 PM (14 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:
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)
Message:

Removed MissingValueException from Exceptions.

Location:
src
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/Action.cpp

    r882678 r336e33  
    2828#include "Actions/OptionRegistry.hpp"
    2929#include "Actions/OptionTrait.hpp"
    30 #include "Exceptions/MissingValueException.hpp"
     30//#include "Actions/ValueStorage.hpp"
    3131#include "UIElements/Dialog.hpp"
    3232#include "CodePatterns/Assert.hpp"
  • src/Actions/ValueStorage.cpp

    r882678 r336e33  
    5959  if (typeid( atom *) == *(OptionRegistry_instance.getOptionByName(name)->getType())) {
    6060    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    61       throw MissingValueException(__FILE__, __LINE__);
     61      throw MissingValueException() << ValueStorageOptionName(name);
    6262    atomID = lexical_cast<int>(CurrentValueMap[name].c_str());
    6363    CurrentValueMap.erase(name);
    6464  } else if (typeid( const atom *) == *(OptionRegistry_instance.getOptionByName(name)->getType())) {
    6565    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    66       throw MissingValueException(__FILE__, __LINE__);
     66      throw MissingValueException() << ValueStorageOptionName(name);
    6767    atomID = lexical_cast<int>(CurrentValueMap[name].c_str());
    6868    CurrentValueMap.erase(name);
     
    8080  if (typeid(const element *) == *(OptionRegistry_instance.getOptionByName(name)->getType())) {
    8181    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    82       throw MissingValueException(__FILE__, __LINE__);
     82      throw MissingValueException() << ValueStorageOptionName(name);
    8383    Z = lexical_cast<int>(CurrentValueMap[name].c_str());
    8484    CurrentValueMap.erase(name);
     
    9696  if (typeid( const molecule *) == *(OptionRegistry_instance.getOptionByName(name)->getType())) {
    9797    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    98       throw MissingValueException(__FILE__, __LINE__);
     98      throw MissingValueException() << ValueStorageOptionName(name);
    9999    molID = lexical_cast<int>(CurrentValueMap[name].c_str());
    100100    CurrentValueMap.erase(name);
     
    113113  if (typeid( Box ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) {
    114114    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    115       throw MissingValueException(__FILE__, __LINE__);
     115      throw MissingValueException() << ValueStorageOptionName(name);
    116116    std::istringstream stream(CurrentValueMap[name]);
    117117    stream >> tmp;
     
    197197  if (typeid( std::vector<const atom *> ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) {
    198198    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    199       throw MissingValueException(__FILE__, __LINE__);
     199      throw MissingValueException() << ValueStorageOptionName(name);
    200200    std::istringstream stream(CurrentValueMap[name]);
    201201    CurrentValueMap.erase(name);
     
    228228  if (typeid( std::vector<const element *> ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) {
    229229    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    230       throw MissingValueException(__FILE__, __LINE__);
     230      throw MissingValueException() << ValueStorageOptionName(name);
    231231    std::istringstream stream(CurrentValueMap[name]);
    232232    CurrentValueMap.erase(name);
     
    258258  if (typeid( std::vector<const molecule *> ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) {
    259259    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    260       throw MissingValueException(__FILE__, __LINE__);
     260      throw MissingValueException() << ValueStorageOptionName(name);
    261261    std::istringstream stream(CurrentValueMap[name]);
    262262    CurrentValueMap.erase(name);
     
    287287  if (typeid( boost::filesystem::path ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) {
    288288    if (CurrentValueMap.find(name) == CurrentValueMap.end())
    289       throw MissingValueException(__FILE__, __LINE__);
     289      throw MissingValueException() << ValueStorageOptionName(name);
    290290    std::istringstream stream(CurrentValueMap[name]);
    291291    CurrentValueMap.erase(name);
  • src/Actions/ValueStorage.hpp

    r882678 r336e33  
    2727#include "Actions/OptionTrait.hpp"
    2828#include "Actions/OptionRegistry.hpp"
    29 #include "Exceptions/MissingValueException.hpp"
    3029#include "CodePatterns/Assert.hpp"
    3130#include "CodePatterns/Singleton.hpp"
     
    6362 */
    6463struct IllegalTypeException : virtual ValueStorageException { };
     64
     65/** Exception thrown when ValueStorage is missing a requested value.
     66 */
     67struct MissingValueException : virtual ValueStorageException { };
     68
    6569
    6670class MapOfActionsTest;
     
    123127    if (typeid( T ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { // constructor of type_info is private, hence can only store by ref or ptr
    124128      if (CurrentValueMap.find(name) == CurrentValueMap.end())
    125         throw MissingValueException(__FILE__, __LINE__);
     129        throw MissingValueException() << ValueStorageOptionName(name);
    126130      _T = lexical_cast<T>(CurrentValueMap[name].c_str());
    127131      CurrentValueMap.erase(name);
     
    138142    if (typeid( std::vector<T> ) == *(OptionRegistry_instance.getOptionByName(name)->getType())) { // constructor of type_info is private, hence can only store by ref or ptr
    139143      if (CurrentValueMap.find(name) == CurrentValueMap.end())
    140         throw MissingValueException(__FILE__, __LINE__);
     144        throw MissingValueException() << ValueStorageOptionName(name);
    141145      std::istringstream stream(CurrentValueMap[name]);
    142146      CurrentValueMap.erase(name);
  • src/Exceptions/Makefile.am

    r882678 r336e33  
    88
    99EXCEPTIONSOURCE = \
    10   CustomException.cpp \
    11   MissingValueException.cpp
     10  CustomException.cpp
    1211       
    1312                                 
    1413EXCEPTIONHEADER = \
    15   CustomException.hpp \
    16   MissingValueException.hpp
     14  CustomException.hpp
    1715
    1816
Note: See TracChangeset for help on using the changeset viewer.