Changeset b88fe4 for src


Ignore:
Timestamp:
Apr 6, 2011, 1:50:41 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:
b94634
Parents:
00bb38
git-author:
Frederik Heber <heber@…> (04/01/11 22:03:21)
git-committer:
Frederik Heber <heber@…> (04/06/11 13:50:41)
Message:

Removed Exceptions/FormulaStringParseException.

  • is now boost::exceptions-derived and part of Formula.
Location:
src
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • src/Descriptors/MoleculeFormulaDescriptor.cpp

    r00bb38 rb88fe4  
    2323#include "MoleculeFormulaDescriptor_impl.hpp"
    2424
     25#include "Formula.hpp"
    2526#include "molecule.hpp"
    2627
  • src/Descriptors/MoleculeFormulaDescriptor.hpp

    r00bb38 rb88fe4  
    1616
    1717#include "Descriptors/MoleculeDescriptor.hpp"
    18 #include "Exceptions/FormulaStringParseException.hpp"
    1918
    20 class Formula;
     19#include "Formula.hpp"
    2120
    2221MoleculeDescriptor MoleculeByFormula(const Formula&);
  • src/Exceptions/Makefile.am

    r00bb38 rb88fe4  
    1212  MissingValueException.cpp \
    1313  NotOnSurfaceException.cpp \
    14   ShapeException.cpp \
    15   FormulaStringParseException.cpp
     14  ShapeException.cpp
    1615       
    1716                                 
     
    2019  IllegalTypeException.hpp \
    2120  MissingValueException.hpp \
    22   NotOnSurfaceException.hpp \
    23   FormulaStringParseException.hpp
     21  NotOnSurfaceException.hpp
    2422
    2523
  • src/Formula.cpp

    r00bb38 rb88fe4  
    103103      sub.parseFromString(++it,end,nextdelim);
    104104      if(!sub.getElementCount()){
    105         throw(FormulaStringParseException(__FILE__,__LINE__));
     105        throw FormulaStringParseException() << FormulaString( string(it, end) );
    106106      }
    107107      int count = parseMaybeNumber(++it,end);
     
    112112    // Atom names start with a capital letter
    113113    if(!CapitalLetters.isInRange(*it))
    114       throw(FormulaStringParseException(__FILE__,__LINE__));
     114      throw FormulaStringParseException() << FormulaString( string(it, end) );
    115115    shorthand+=(*it++);
    116116    // the rest of the name follows
     
    120120    // test if the shorthand exists
    121121    if(!World::getInstance().getPeriode()->FindElement(shorthand))
    122       throw(FormulaStringParseException(__FILE__,__LINE__));
     122      throw FormulaStringParseException() << FormulaString( string(it, end) );
    123123    // done, we can get the next one
    124124    addElements(shorthand,count);
    125125  }
    126126  if(it==end && delimiter!=0){
    127     throw(FormulaStringParseException(__FILE__,__LINE__));
     127    throw FormulaStringParseException() << FormulaString( string(it, end) );
    128128  }
    129129}
  • src/Formula.hpp

    r00bb38 rb88fe4  
    1919#include <iterator>
    2020
    21 #include "Exceptions/FormulaStringParseException.hpp"
    22 
    2321#include "types.hpp"
    2422
    2523#include "CodePatterns/enumeration.hpp"
    2624
     25#include <exception>
     26#include <boost/exception.hpp>
     27
     28/** ============================= Begin of Exceptions ===================== */
     29
     30/** Base class for all exceptions regarding Formula.
     31 *
     32 */
     33struct FormulaException : virtual std::exception, virtual boost::exception { };
     34
     35/** Exception information for FormulaException: string.
     36 */
     37typedef boost::error_info<struct tag_FormulaString, const std::string> FormulaString;
     38
     39/** Exception thrown when a string cannot be parsed as a formula.
     40 */
     41struct FormulaStringParseException : virtual FormulaException { };
     42
     43/** ============================== end of Exceptions ====================== */
     44
    2745class element;
    28 
    2946
    3047class Formula
Note: See TracChangeset for help on using the changeset viewer.