#include <dune/common/parameterizedobject.hh>
|
typedef KeyT | Key |
| The typ of the keys.
|
|
using | Type = TypeT |
| The type of objects created by the factory.
|
|
|
Type | create (Key const &key, Args ... args) const |
| Creates an object identified by a key from given parameters.
|
|
template<class Impl > |
void | define (Key const &key) |
| Registers a new type with a key.
|
|
template<class F , typename std::enable_if< has_proper_signature< F >(PriorityTag< 42 >()), int >::type = 0> |
void | define (Key const &key, F &&f) |
| Registers a new creator with a key.
|
|
template<class Impl , typename std::enable_if< std::is_convertible< Impl, Type >::value and not std::is_convertible< Impl, Creator >::value, int >::type = 0> |
void | define (Key const &key, Impl &&t) |
| Registers a new type with a key.
|
|
bool | contains (Key const &key) const |
|
◆ Creator
template<typename TypeT , typename KeyT , typename... Args>
◆ Key
template<typename TypeT , typename KeyT , typename... Args>
◆ Type
template<typename TypeT , typename KeyT , typename... Args>
The type of objects created by the factory.
◆ contains()
template<typename TypeT , typename KeyT , typename... Args>
◆ create()
template<typename TypeT , typename KeyT , typename... Args>
Creates an object identified by a key from given parameters.
- Parameters
-
key | The key the object is registered with |
- See also
- define.
- Parameters
-
args | The parameters used for the construction. |
- Returns
- The object wrapped as Type
◆ define() [1/3]
template<typename TypeT , typename KeyT , typename... Args>
template<class Impl >
Registers a new type with a key.
After registration objects of this type can be constructed with the specified key using a matching default creation function. If Type is a unique_ptr or shared_ptr, the object is created via make_unique or make_shared, respectively. Otherwise a constructor of Impl is called.
- Template Parameters
-
Impl | The type of objects to create. |
- Parameters
-
key | The key associated with this type. |
◆ define() [2/3]
template<typename TypeT , typename KeyT , typename... Args>
Registers a new creator with a key.
After registration objects can be constructed using the given creator function.
- Template Parameters
-
F | Type of creator function. This must be callable with Args... . |
- Parameters
-
key | The key associated with this type. |
f | Function for creation of objects of type Impl |
- Todo:
- Replace has_proper_signature by concept check
◆ define() [3/3]
template<typename TypeT , typename KeyT , typename... Args>
template<class Impl , typename std::enable_if< std::is_convertible< Impl,
Type >::value and not std::is_convertible< Impl,
Creator >::value, int >::type = 0>
Registers a new type with a key.
After registration objects of this type can be created. This method will store a copy of the given object and create will hand out a copy to this.
- Template Parameters
-
Impl | The type of objects to create. |
- Parameters
-
key | The key associated with this type. |
t | reference object, "create" will call the copy-constructor |
note, this does not work fundamental types
◆ has_proper_signature() [1/2]
template<typename TypeT , typename KeyT , typename... Args>
template<class F >
|
inlinestaticconstexprprotected |
◆ has_proper_signature() [2/2]
template<typename TypeT , typename KeyT , typename... Args>
template<class F >
|
inlinestaticconstexprprotected |
The documentation for this class was generated from the following file: