Changeset e73a8a2
- Timestamp:
- Mar 11, 2010, 2:08:44 PM (15 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:
- aee1a3
- Parents:
- 7ca806
- Location:
- src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Action.cpp
r7ca806 re73a8a2 17 17 { 18 18 if(_doRegister){ 19 ActionRegistry::get Registry()->registerAction(this);19 ActionRegistry::getInstance().registerAction(this); 20 20 } 21 21 } -
src/Actions/ActionRegistry.cpp
r7ca806 re73a8a2 9 9 #include "Actions/Action.hpp" 10 10 11 #include "Patterns/Singleton_impl.hpp" 12 11 13 #include <string> 12 14 #include <cassert> … … 14 16 15 17 using namespace std; 16 17 ActionRegistry *ActionRegistry::theInstance=0;18 18 19 19 ActionRegistry::ActionRegistry() … … 43 43 } 44 44 45 // singleton stuff 46 ActionRegistry* ActionRegistry::getRegistry(){ 47 if(!theInstance){ 48 theInstance = new ActionRegistry(); 49 } 50 return theInstance; 51 } 52 53 void ActionRegistry::purgeRegistry(){ 54 if(theInstance){ 55 delete theInstance; 56 theInstance = 0; 57 } 58 } 45 CONSTRUCT_SINGLETON(ActionRegistry) -
src/Actions/ActionRegistry.hpp
r7ca806 re73a8a2 12 12 #include <map> 13 13 14 #include "Patterns/Singleton.hpp" 15 14 16 class Action; 15 17 16 class ActionRegistry 18 class ActionRegistry : public Singleton<ActionRegistry> 17 19 { 20 friend class Singleton<ActionRegistry>; 18 21 public: 19 22 Action* getActionByName(const std::string); … … 23 26 std::map<const std::string,Action*> actionMap; 24 27 25 // singleton stuff26 public:27 static ActionRegistry* getRegistry();28 static void purgeRegistry();29 28 private: 30 29 ActionRegistry(); 31 30 virtual ~ActionRegistry(); 32 static ActionRegistry *theInstance;33 31 }; 34 32 -
src/builder.cpp
r7ca806 re73a8a2 2177 2177 logger::purgeInstance(); 2178 2178 errorLogger::purgeInstance(); 2179 ActionRegistry::purge Registry();2179 ActionRegistry::purgeInstance(); 2180 2180 } 2181 2181 -
src/unittests/SingletonTest.cpp
r7ca806 re73a8a2 87 87 CPPUNIT_ASSERT_EQUAL(1,SingletonStub1::count1); 88 88 CPPUNIT_ASSERT_EQUAL(1,SingletonStub2::count1); 89 // no calls to the destructor should have occured so far 90 CPPUNIT_ASSERT_EQUAL(0,SingletonStub1::count2); 91 CPPUNIT_ASSERT_EQUAL(0,SingletonStub2::count2); 89 92 90 93 SingletonStub1::purgeInstance(); -
src/unittests/atomsCalculationTest.cpp
r7ca806 re73a8a2 63 63 void atomsCalculationTest::tearDown(){ 64 64 World::purgeInstance(); 65 ActionRegistry::purge Registry();65 ActionRegistry::purgeInstance(); 66 66 } 67 67 -
src/unittests/manipulateAtomsTest.cpp
r7ca806 re73a8a2 78 78 void manipulateAtomsTest::tearDown(){ 79 79 World::purgeInstance(); 80 ActionRegistry::purge Registry();80 ActionRegistry::purgeInstance(); 81 81 } 82 82
Note:
See TracChangeset
for help on using the changeset viewer.