OOPS
oops::ModelFactory< MODEL > Class Template Referenceabstract

Model factory. More...

#include <ModelBase.h>

Inheritance diagram for oops::ModelFactory< MODEL >:

Public Member Functions

virtual ~ModelFactory ()=default
 

Static Public Member Functions

static ModelBase< MODEL > * create (const Geometry_ &, const ModelParametersBase &parameters)
 Create and return a new model. More...
 
static std::unique_ptr< ModelParametersBasecreateParameters (const std::string &name)
 Create and return an instance of the subclass of ModelParametersBase storing parameters of models of the specified type. More...
 
static std::vector< std::string > getMakerNames ()
 Return the names of all models that can be created by one of the registered makers. More...
 

Protected Member Functions

 ModelFactory (const std::string &name)
 Register a maker able to create models of type name. More...
 

Private Types

typedef Geometry< MODEL > Geometry_
 

Private Member Functions

virtual ModelBase< MODEL > * make (const Geometry_ &, const ModelParametersBase &)=0
 
virtual std::unique_ptr< ModelParametersBasemakeParameters () const =0
 

Static Private Member Functions

static std::map< std::string, ModelFactory< MODEL > * > & getMakers ()
 

Detailed Description

template<typename MODEL>
class oops::ModelFactory< MODEL >

Model factory.

Definition at line 76 of file ModelBase.h.

Member Typedef Documentation

◆ Geometry_

template<typename MODEL >
typedef Geometry<MODEL> oops::ModelFactory< MODEL >::Geometry_
private

Definition at line 131 of file ModelBase.h.

Constructor & Destructor Documentation

◆ ~ModelFactory()

template<typename MODEL >
virtual oops::ModelFactory< MODEL >::~ModelFactory ( )
virtualdefault

◆ ModelFactory()

template<typename MODEL >
oops::ModelFactory< MODEL >::ModelFactory ( const std::string &  name)
explicitprotected

Register a maker able to create models of type name.

Definition at line 198 of file ModelBase.h.

Member Function Documentation

◆ create()

template<typename MODEL >
ModelBase< MODEL > * oops::ModelFactory< MODEL >::create ( const Geometry_ geom,
const ModelParametersBase parameters 
)
static

Create and return a new model.

The model's type is determined by the name attribute of parameters. parameters must be an instance of the subclass of ModelParametersBase associated with that model type, otherwise an exception will be thrown.

Definition at line 210 of file ModelBase.h.

◆ createParameters()

template<typename MODEL >
std::unique_ptr< ModelParametersBase > oops::ModelFactory< MODEL >::createParameters ( const std::string &  name)
static

Create and return an instance of the subclass of ModelParametersBase storing parameters of models of the specified type.

Definition at line 227 of file ModelBase.h.

◆ getMakerNames()

template<typename MODEL >
static std::vector<std::string> oops::ModelFactory< MODEL >::getMakerNames ( )
inlinestatic

Return the names of all models that can be created by one of the registered makers.

Definition at line 146 of file ModelBase.h.

Here is the call graph for this function:

◆ getMakers()

template<typename MODEL >
static std::map< std::string, ModelFactory<MODEL> * >& oops::ModelFactory< MODEL >::getMakers ( )
inlinestaticprivate

Definition at line 161 of file ModelBase.h.

Here is the caller graph for this function:

◆ make()

template<typename MODEL >
virtual ModelBase<MODEL>* oops::ModelFactory< MODEL >::make ( const Geometry_ ,
const ModelParametersBase  
)
privatepure virtual

◆ makeParameters()

template<typename MODEL >
virtual std::unique_ptr<ModelParametersBase> oops::ModelFactory< MODEL >::makeParameters ( ) const
privatepure virtual

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