Ignore:
Timestamp:
May 7, 2016, 7:03:56 AM (9 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_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:
fde8e7
Parents:
086e30
git-author:
Frederik Heber <heber@…> (02/27/16 13:09:08)
git-committer:
Frederik Heber <heber@…> (05/07/16 07:03:56)
Message:

PotentialFactory now also complies to templated StreamFactory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Potentials/PotentialFactory.hpp

    r086e30 rf6abb1  
    2121#include "Potentials/EmpiricalPotential.hpp"
    2222#include "Potentials/Specifics/PotentialTypes.hpp"
     23#include "Potentials/StreamFactory_EmpiricalPotential.hpp"
    2324
    2425/** Class that creates instances of potentials.
     
    2728 *
    2829 */
    29 class PotentialFactory : public Singleton<PotentialFactory>
     30class PotentialFactory :
     31    public Singleton<PotentialFactory>,
     32    public StreamFactory<EmpiricalPotential>
    3033{
    3134  //!> make Singleton template friend
    3235  friend class Singleton<PotentialFactory>;
    3336
     37protected:
     38
     39  /** Returns a default potential to which only we have access.
     40   *
     41   */
     42  EmpiricalPotential* getDefaultPotential(const std::string &_name) const;
     43
    3444public:
     45
    3546  /** Creates an instance of the requested potential.
    3647   *
     
    4152      const std::string &potentialtype,
    4253      const SerializablePotential::ParticleTypes_t &charges) const;
    43 
    44   /** Creates an instance of the requested potential.
    45    *
    46    * \param potentialtype key of potential to create
    47    * \param serialized stream to parser SerializablePotential from
    48    */
    49   EmpiricalPotential *createInstance(
    50       const std::string &potentialtype,
    51       std::istream &serialized) const;
    5254
    5355  //!> typedef for map to lookup type for a given name
     
    6365  static TypeToName_t TypeToName;
    6466
     67  static enum PotentialTypes getTypeForName(const std::string &_name);
     68
     69  static const std::string & getNameForType(enum PotentialTypes _type);
     70
    6571private:
    6672  PotentialFactory() {}
Note: See TracChangeset for help on using the changeset viewer.