Changeset 387a84 for src/UIElements
- Timestamp:
- Feb 14, 2016, 12:34:28 PM (9 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:
- e7ed12
- Parents:
- 5aec20
- git-author:
- Frederik Heber <heber@…> (01/05/16 22:26:38)
- git-committer:
- Frederik Heber <heber@…> (02/14/16 12:34:28)
- Location:
- src/UIElements/Qt4/InstanceBoard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Qt4/InstanceBoard/ObservedValuesContainer.hpp
r5aec20 r387a84 216 216 const onDestroy_t onDestroy; 217 217 218 //!> internal mutex to have atomic access to control maps 219 mutable boost::recursive_mutex atomic_mutex; 220 218 221 private: 219 222 /** Internal function to check whether an Observed instance identified by -
src/UIElements/Qt4/InstanceBoard/ObservedValuesContainer_impl.hpp
r5aec20 r387a84 18 18 19 19 #include "CodePatterns/Assert.hpp" 20 21 #include <boost/thread/recursive_mutex.hpp> 20 22 21 23 template <class T, typename id> … … 32 34 ObservedValuesContainer<T,id>::~ObservedValuesContainer() 33 35 { 36 boost::recursive_mutex::scoped_lock lock(atomic_mutex); 34 37 for (typename CountedObservedValues_t::iterator iter = ObservedValues.begin(); 35 38 iter != ObservedValues.end(); ++iter) { … … 47 50 typename T::ptr ObservedValuesContainer<T,id>::get(const id _id) 48 51 { 52 boost::recursive_mutex::scoped_lock lock(atomic_mutex); 49 53 LOG(3, "DEBUG: ObservedValuesContainer got get() for an observed value of " 50 54 << NameOfType << " " << _id); … … 60 64 const id _id) 61 65 { 66 boost::recursive_mutex::scoped_lock lock(atomic_mutex); 62 67 LOG(3, "DEBUG: ObservedValuesContainer got markObservedValuesAsConnected() for an observed value of " 63 68 << NameOfType << " " << _id); … … 73 78 const id _id) const 74 79 { 80 boost::recursive_mutex::scoped_lock lock(atomic_mutex); 75 81 typename CountedObservedValues_t::const_iterator iter = ObservedValues.find(_id); 76 82 return ((iter != ObservedValues.end()) && (iter->second.getEraseCandidate().second == 0)); … … 81 87 const id _id) 82 88 { 89 boost::recursive_mutex::scoped_lock lock(atomic_mutex); 83 90 LOG(3, "DEBUG: ObservedValuesContainer got markObservedValuesAsDisconnected() for an observed value of " 84 91 << NameOfType << " " << _id); … … 100 107 const id _id) const 101 108 { 109 boost::recursive_mutex::scoped_lock lock(atomic_mutex); 102 110 typename subjectKilledCount_t::const_iterator iter = subjectKilledCount.find(_id); 103 111 return ((iter != subjectKilledCount.end()) && (iter->second == T::MAX_ObservedTypes)); … … 107 115 void ObservedValuesContainer<T,id>::countsubjectKilled(const id _id) 108 116 { 117 boost::recursive_mutex::scoped_lock lock(atomic_mutex); 109 118 LOG(3, "DEBUG: ObservedValuesContainer got subjectKilled() for an observed value of " 110 119 << NameOfType << " " << _id); … … 127 136 void ObservedValuesContainer<T,id>::removeObservedValues(const id _id) 128 137 { 138 boost::recursive_mutex::scoped_lock lock(atomic_mutex); 129 139 LOG(3, "DEBUG: ObservedValuesContainer removes " << NameOfType << " " << _id); 130 140 // call callback function … … 141 151 void ObservedValuesContainer<T,id>::eraseObservedValues(const id _id) 142 152 { 153 boost::recursive_mutex::scoped_lock lock(atomic_mutex); 143 154 #ifndef NDEBUG 144 155 std::pair< typename std::set<id>::iterator, bool > inserter = … … 156 167 bool ObservedValuesContainer<T,id>::checkMarkedForErase(const id _id) const 157 168 { 169 boost::recursive_mutex::scoped_lock lock(atomic_mutex); 158 170 return MarkedForErase.count(_id); 159 171 } … … 162 174 void ObservedValuesContainer<T,id>::insert(const id _id, const typename T::ptr &_obsvalues) 163 175 { 176 boost::recursive_mutex::scoped_lock lock(atomic_mutex); 164 177 typename ObservedValuesContainer<T,id>::RefCountedObserved::Value_t value(std::make_pair(_obsvalues,0)); 165 178 typename CountedObservedValues_t::iterator iter = ObservedValues.find(_id); … … 184 197 bool ObservedValuesContainer<T,id>::changeIdentifier(const id _oldid, const id _newid) 185 198 { 199 boost::recursive_mutex::scoped_lock lock(atomic_mutex); 186 200 const typename CountedObservedValues_t::iterator Colditer = ObservedValues.find(_oldid); 187 201 const typename CountedObservedValues_t::iterator Cnewiter = ObservedValues.find(_newid); … … 222 236 bool ObservedValuesContainer<T,id>::isPresent(const id _id) const 223 237 { 238 boost::recursive_mutex::scoped_lock lock(atomic_mutex); 224 239 typename CountedObservedValues_t::const_iterator iter = ObservedValues.find(_id); 225 240 return (iter != ObservedValues.end());
Note:
See TracChangeset
for help on using the changeset viewer.