Changeset 2ba827


Ignore:
Timestamp:
Feb 3, 2010, 4:42:06 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
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:
50fc88c
Parents:
317df8
Message:

Changed all observed places to new observer structure

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/Patterns/Observer.hpp

    r317df8 r2ba827  
    8787
    8888#define OBSERVE Observable::_Observable_protector _scope_obs_protector(this)
    89 #define START_OBSERVER Observable::start_observer_internal(this);do{do{}while(0)
    90 #define FINISH_OBSERVER }while(0);Observable::finish_observer_internal(this)
    91 #define RETURN_OBSERVER( retval ) do{Observable::finish_observer_internal(this); return (retval);}while(0)
     89// deprecated macros from before RAII was used
     90//#define START_OBSERVER Observable::start_observer_internal(this);do{do{}while(0)
     91//#define FINISH_OBSERVER }while(0);Observable::finish_observer_internal(this)
     92//#define RETURN_OBSERVER( retval ) do{Observable::finish_observer_internal(this); return (retval);}while(0)
    9293#endif /* OBSERVER_HPP_ */
  • src/molecule.cpp

    r317df8 r2ba827  
    7171
    7272void molecule::setName(const std::string _name){
    73   START_OBSERVER;
     73  OBSERVE;
    7474  strncpy(name,_name.c_str(),MAXSTRINGSIZE);
    75   FINISH_OBSERVER;
    7675}
    7776
     
    104103{
    105104  bool retval = false;
    106   START_OBSERVER;
     105  OBSERVE;
    107106  if (pointer != NULL) {
    108107    pointer->sort = &pointer->nr;
     
    123122    retval = add(pointer, end);
    124123  }
    125   FINISH_OBSERVER;
    126124  return retval;
    127125};
     
    135133{
    136134  atom *retval = NULL;
    137   START_OBSERVER;
     135  OBSERVE;
    138136  if (pointer != NULL) {
    139137    atom *walker = new atom(pointer);
     
    147145    retval=walker;
    148146  }
    149   FINISH_OBSERVER;
    150147  return retval;
    151148};
     
    188185{
    189186  bool AllWentWell = true;    // flag gathering the boolean return value of molecule::AddAtom and other functions, as return value on exit
    190   START_OBSERVER;
     187  OBSERVE;
    191188  double bondlength;  // bond length of the bond to be replaced/cut
    192189  double bondangle;  // bond angle of the bond to be replaced/cut
     
    235232  if (BondRescale == -1) {
    236233    eLog() << Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl;
    237     RETURN_OBSERVER(false);
     234    return false;
    238235    BondRescale = bondlength;
    239236  } else {
     
    315312      if (bondangle == -1) {
    316313        eLog() << Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl;
    317         RETURN_OBSERVER(false);
     314        return false;
    318315        bondangle = 0;
    319316      }
     
    442439  Free(&matrix);
    443440
    444   FINISH_OBSERVER;
    445441//  Log() << Verbose(3) << "End of AddHydrogenReplacementAtom." << endl;
    446442  return AllWentWell;
     
    468464    return false;
    469465
    470   START_OBSERVER;
     466  OBSERVE;
    471467  getline(xyzfile,line,'\n'); // Read numer of atoms in file
    472468  input = new istringstream(line);
     
    509505  xyzfile.close();
    510506  delete(input);
    511   FINISH_OBSERVER;
    512507  return true;
    513508};
  • src/moleculelist.cpp

    r317df8 r2ba827  
    5050void MoleculeListClass::insert(molecule *mol)
    5151{
    52   START_OBSERVER;
     52  OBSERVE;
    5353  mol->IndexNr = MaxIndex++;
    5454  ListOfMolecules.push_back(mol);
    5555  mol->signOn(this);
    56   FINISH_OBSERVER;
    5756};
    5857
     
    892891
    893892void MoleculeListClass::createNewMolecule(periodentafel *periode) {
    894   START_OBSERVER;
     893  OBSERVE;
    895894  molecule *mol = NULL;
    896895  mol = new molecule(periode);
    897896  insert(mol);
    898   FINISH_OBSERVER;
    899897};
    900898
  • src/unittests/CacheableTest.cpp

    r317df8 r2ba827  
    2727
    2828  void setX(int _x){
    29     START_OBSERVER;;
     29    OBSERVE;
    3030    x = _x;
    31     FINISH_OBSERVER;
    3231  }
    3332
    3433  void setY
    3534  (int _y){
    36     START_OBSERVER;;
     35    OBSERVE;
    3736    y = _y;
    38     FINISH_OBSERVER;
    3937  }
    4038
    4139  void setZ(int _z){
    42     START_OBSERVER;;
     40    OBSERVE;
    4341    z = _z;
    44     FINISH_OBSERVER;
    4542  }
    4643
Note: See TracChangeset for help on using the changeset viewer.