Simpatico  v1.10
List of all members | Public Member Functions | Protected Member Functions
McMd::PairFactory Class Reference

Detailed Description

Factory for subclasses MdPairPotential or McPairPotential.

This class is not derived from the Factory template because it provides a different interface, with separate mcFactory() and mdFactory() methods to create McPairPotential and MdPairPotential objects. Unlike a standard Factory, it also does not provide a readObject method, and so does not require a param communicator.

Definition at line 34 of file mcMd/potentials/pair/PairFactory.h.

#include <PairFactory.h>

Public Member Functions

 PairFactory ()
 Constructor. More...
 
virtual ~PairFactory ()
 Destructor. More...
 
void addSubfactory (PairFactory &subfactory)
 Add a new subfactory to the list. More...
 
virtual McPairPotentialmcFactory (const std::string &subclass, System &system) const
 Return a pointer to a new McPairPotential, if possible. More...
 
virtual MdPairPotentialmdFactory (const std::string &subclass, System &system) const
 Return a pointer to a new McPairPotential, if possible. More...
 
virtual MdPairPotentialmdFactory (McPairPotential &potential) const
 Create an MdPairPotential from a McPairPotential. More...
 

Protected Member Functions

McPairPotentialtryMcSubfactories (const std::string &className, System &system) const
 Search subfactories for match to McPairPotential subclass name. More...
 
MdPairPotentialtryMdSubfactories (const std::string &className, System &system) const
 Search subfactories for match to MdPairPotential subclass name. More...
 
MdPairPotentialtryMdSubfactories (McPairPotential &potential) const
 Search through subfactories for match for an mc potential. More...
 

Constructor & Destructor Documentation

McMd::PairFactory::PairFactory ( )

Constructor.

Default constructor.

Definition at line 42 of file mcMd/potentials/pair/PairFactory.cpp.

virtual McMd::PairFactory::~PairFactory ( )
inlinevirtual

Member Function Documentation

void McMd::PairFactory::addSubfactory ( PairFactory subfactory)

Add a new subfactory to the list.

If this Factory has a param communicator, this method also sets the child subfactory communicator to that of the parent.

Parameters
subfactoryNew subfactory to be added

Definition at line 48 of file mcMd/potentials/pair/PairFactory.cpp.

Referenced by ~PairFactory().

McPairPotential * McMd::PairFactory::mcFactory ( const std::string &  subclass,
System system 
) const
virtual

Return a pointer to a new McPairPotential, if possible.

Parameters
subclassname of desired subclass of McPairPotential
systemassociated System

Definition at line 55 of file mcMd/potentials/pair/PairFactory.cpp.

Referenced by McMd::McSystem::loadParameters(), McMd::McSystem::readParameters(), and ~PairFactory().

MdPairPotential * McMd::PairFactory::mdFactory ( const std::string &  subclass,
System system 
) const
virtual

Return a pointer to a new McPairPotential, if possible.

Parameters
subclassname of desired subclass of MdPairPotential
systemassociated System

Definition at line 85 of file mcMd/potentials/pair/PairFactory.cpp.

References McMd::Simulation::hasCoulomb(), and McMd::System::simulation().

Referenced by McMd::MdSystem::loadParameters(), McMd::MdSystem::MdSystem(), McMd::MdSystem::readParameters(), and ~PairFactory().

MdPairPotential * McMd::PairFactory::mdFactory ( McPairPotential potential) const
virtual

Create an MdPairPotential from a McPairPotential.

Parameters
potentialMcPairPotential to be cloned

Definition at line 147 of file mcMd/potentials/pair/PairFactory.cpp.

References McMd::PairPotential::interactionClassName().

McPairPotential * McMd::PairFactory::tryMcSubfactories ( const std::string &  className,
System system 
) const
protected

Search subfactories for match to McPairPotential subclass name.

Parameters
classNamename of subclass
systemassociated System
Returns
base class pointer to new McPairPotential, or a null pointer.

Definition at line 186 of file mcMd/potentials/pair/PairFactory.cpp.

Referenced by ~PairFactory().

MdPairPotential * McMd::PairFactory::tryMdSubfactories ( const std::string &  className,
System system 
) const
protected

Search subfactories for match to MdPairPotential subclass name.

Parameters
classNamename of subclass
systemassociated System
Returns
base class pointer to new MdPairPotential, or a null pointer.

Definition at line 200 of file mcMd/potentials/pair/PairFactory.cpp.

Referenced by ~PairFactory().

MdPairPotential * McMd::PairFactory::tryMdSubfactories ( McPairPotential potential) const
protected

Search through subfactories for match for an mc potential.

Parameters
potentialMcPairPotential to be cloned
Returns
base class pointer to new MdPairPotential, or a null pointer.

Definition at line 213 of file mcMd/potentials/pair/PairFactory.cpp.


The documentation for this class was generated from the following files: