47#include "integrators/IntegratorCreator.hpp"
52 IntegratorFactory::~IntegratorFactory() {
53 Utils::deletePointers(creatorMap_);
58 .insert(CreatorMapType::value_type(creator->getIdent(), creator))
63 return creatorMap_.erase(
id) == 1;
68 CreatorMapType::iterator i = creatorMap_.find(
id);
69 if (i != creatorMap_.end()) {
71 return (i->second)->create(info);
78 IdentVectorType idents;
79 CreatorMapType::iterator i;
81 for (i = creatorMap_.begin(); i != creatorMap_.end(); ++i) {
82 idents.push_back(i->first);
89 IntegratorFactory::IdentVectorType idents;
90 IntegratorFactory::IdentVectorIterator i;
94 o <<
"Avaliable type identifiers in this factory: " << std::endl;
95 for (i = idents.begin(); i != idents.end(); ++i) {
Factory pattern and Singleton Pattern are used to define an interface for creating an Integrator.
bool unregisterIntegrator(const std::string &id)
Unregisters the creator for the given type identifier.
IdentVectorType getIdents()
Returns all of the registed type identifiers.
Integrator * createIntegrator(const std::string &id, SimInfo *info)
Looks up the type identifier in the internal map.
bool registerIntegrator(IntegratorCreator *creator)
Registers a creator with a type identifier.
Declaration of the Integrator base class, which all other integrators inherit from.
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.