OpenMD 3.1
Molecular Dynamics in the Open
|
Factory pattern and Singleton Pattern are used to define an interface for creating an Optimization. More...
#include <OptimizationFactory.hpp>
Public Types | |
using | CreatorMapType = std::map<std::string, OptimizationCreator*> |
using | IdentVectorType = std::vector<std::string> |
using | IdentVectorIterator = std::vector<std::string>::iterator |
Public Member Functions | |
bool | registerOptimization (OptimizationCreator *creator) |
Registers a creator with a type identifier. | |
bool | unregisterOptimization (const std::string &id) |
Unregisters the creator for the given type identifier. | |
QuantLib::OptimizationMethod * | createOptimization (const std::string &id, SimInfo *info) |
Looks up the type identifier in the internal map. | |
IdentVectorType | getIdents () |
Returns all of the registed type identifiers. | |
Static Public Member Functions | |
static OptimizationFactory & | getInstance () |
Returns an instance of Optimization factory. | |
Factory pattern and Singleton Pattern are used to define an interface for creating an Optimization.
Definition at line 68 of file OptimizationFactory.hpp.
using OpenMD::OptimizationFactory::CreatorMapType = std::map<std::string, OptimizationCreator*> |
Definition at line 70 of file OptimizationFactory.hpp.
using OpenMD::OptimizationFactory::IdentVectorIterator = std::vector<std::string>::iterator |
Definition at line 72 of file OptimizationFactory.hpp.
using OpenMD::OptimizationFactory::IdentVectorType = std::vector<std::string> |
Definition at line 71 of file OptimizationFactory.hpp.
QuantLib::OptimizationMethod * OpenMD::OptimizationFactory::createOptimization | ( | const std::string & | id, |
SimInfo * | info ) |
Looks up the type identifier in the internal map.
If it is found, it invokes the corresponding creator for the type identifier and returns its result.
id | the identification of the concrete object |
info | pointer to the SimInfo object |
Definition at line 66 of file OptimizationFactory.cpp.
std::vector< std::string > OpenMD::OptimizationFactory::getIdents | ( | ) |
Returns all of the registed type identifiers.
Definition at line 77 of file OptimizationFactory.cpp.
Referenced by OpenMD::operator<<().
|
inlinestatic |
Returns an instance of Optimization factory.
Definition at line 78 of file OptimizationFactory.hpp.
Referenced by OpenMD::registerOptimizers().
bool OpenMD::OptimizationFactory::registerOptimization | ( | OptimizationCreator * | creator | ) |
Registers a creator with a type identifier.
creator | the object responsible to create the concrete object |
Definition at line 56 of file OptimizationFactory.cpp.
Referenced by OpenMD::registerOptimizers().
bool OpenMD::OptimizationFactory::unregisterOptimization | ( | const std::string & | id | ) |
Unregisters the creator for the given type identifier.
If the type identifier was previously registered, the function returns true.
id | the identification of the concrete object |
Definition at line 62 of file OptimizationFactory.cpp.