Changeset 7188b1 for src/World.hpp
- Timestamp:
- Oct 6, 2011, 4:06:10 PM (13 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:
- db7e6d
- Parents:
- e638f9
- git-author:
- Frederik Heber <heber@…> (09/01/11 13:49:14)
- git-committer:
- Frederik Heber <heber@…> (10/06/11 16:06:10)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/World.hpp
re638f9 r7188b1 55 55 /********************************************** Class World *******************************/ 56 56 57 namespace detail { 58 template <class T> const T* lastChanged() 59 { 60 ASSERT(0, "detail::lastChanged() - only specializations may be used."); 61 return NULL; 62 } 63 } 64 57 65 class World : public Singleton<World>, public Observable 58 66 { … … 84 92 typedef ATOMSET(std::vector) AtomComposite; 85 93 86 /***** getter and setter *****/ 94 /******* Notifications *******/ 95 96 //!> enumeration of present notification types 97 enum NotificationType { 98 AtomInserted, 99 AtomRemoved, 100 AtomChanged, 101 MoleculeInserted, 102 MoleculeRemoved, 103 MoleculeChanged, 104 NotificationType_MAX 105 }; 106 107 //>! access to last changed element (atom or molecule) 108 template <class T> const T* lastChanged() const 109 { return detail::lastChanged<T>(); } 110 111 /***** getter and setter *****/ 87 112 // reference to pointer is used for legacy reason... reference will be removed latter to keep encapsulation of World object 88 113 /** … … 106 131 */ 107 132 config *&getConfig(); 133 134 /** Returns a notification_ptr for a specific type. 135 * 136 * @param type request type 137 * @return reference to instance 138 */ 139 Notification_ptr getNotification(enum NotificationType type) const; 108 140 109 141 /** … … 385 417 void defragMoleculeIdPool(); 386 418 419 friend const atom *detail::lastChanged<atom>(); 420 friend const molecule *detail::lastChanged<molecule>(); 421 static atom *_lastchangedatom; 422 static molecule*_lastchangedmol; 423 387 424 BondGraph *BG; 388 425 periodentafel *periode; … … 442 479 }; 443 480 481 /** Externalized stuff as member functions cannot be specialized without 482 * specializing the class, too. 483 */ 484 namespace detail { 485 template <> inline const atom* lastChanged<atom>() { return World::_lastchangedatom; } 486 template <> inline const molecule* lastChanged<molecule>() { return World::_lastchangedmol; } 487 } 488 489 444 490 #endif /* WORLD_HPP_ */
Note:
See TracChangeset
for help on using the changeset viewer.