This is an object factory for creating objects of some type requested by the user, with a shared base class.
More...
#include <Factory.hpp>
|
static ProductPtr | createObject (const std::string &type) |
| Creates a new object of the class associated with the given type string, and returns a pointer to it. More...
|
|
static ProductPtr | cloneObject (const std::string &type, const ProductPtr original) |
| Clones an new object of the class associated with the given type string, and returns a pointer to it. More...
|
|
template<class Derived > |
static void | addCreator (const std::string &type) |
| Add a creator to the Factory. More...
|
|
template<class Base>
class Opm::Factory< Base >
This is an object factory for creating objects of some type requested by the user, with a shared base class.
The user need only interact with the factory through the static template member addCreator() and the static member function createObject().
template<class Base >
template<class Derived >
static void Opm::Factory< Base >::addCreator |
( |
const std::string & |
type | ) |
|
|
inlinestatic |
Add a creator to the Factory.
After the call, the user may obtain new objects of the Derived type by calling createObject() with the given type string as an argument.
- Template Parameters
-
Derived | the class we want to add a creator for, must inherit the class template parameter Base. |
- Parameters
-
type | the type string with which we want the Factory to associate the class Derived. |
Clones an new object of the class associated with the given type string, and returns a pointer to it.
- Parameters
-
type | the type string of the class that the user wants to have constructed. |
original | (smart) pointer to object to be cloned. |
- Returns
- (smart) pointer to the created object.
Creates a new object of the class associated with the given type string, and returns a pointer to it.
- Parameters
-
type | the type string of the class that the user wants to have constructed. |
- Returns
- (smart) pointer to the created object.
The documentation for this class was generated from the following file: