#include <PluginFactory.hpp>
|
| PluginFactory ()=default |
|
virtual | ~PluginFactory ()=default |
|
| PluginFactory (const PluginFactory &other)=delete |
|
PluginFactory & | operator= (const PluginFactory &other)=delete |
|
void | register_plugin (const std::string &plugin_name, std::function< std::unique_ptr< T >()> make_plugin, const std::map< std::string, std::string > &dictionary=m_empty_dictionary) |
| Add a plugin to the factory. More...
|
|
std::unique_ptr< T > | make_plugin (const std::string &plugin_name) const |
| Create an object of the requested type. If the type was not registered, throws an exception. More...
|
|
std::vector< std::string > | plugin_names (void) const |
| Returns a list of all valid plugin names registered with the factory in the order they were registered. More...
|
|
const std::map< std::string, std::string > & | dictionary (const std::string &plugin_name) const |
| Returns the dictionary of static metadata about a registered type. If the type was not registered, throws an exception. More...
|
|
◆ PluginFactory() [1/2]
◆ ~PluginFactory()
◆ PluginFactory() [2/2]
◆ dictionary()
template<class T >
const std::map<std::string, std::string>& geopm::PluginFactory< T >::dictionary |
( |
const std::string & |
plugin_name | ) |
const |
|
inline |
Returns the dictionary of static metadata about a registered type. If the type was not registered, throws an exception.
- Parameters
-
[in] | plugin_name | Name of the registered type. |
- Returns
- Dictionary of metadata.
◆ make_plugin()
Create an object of the requested type. If the type was not registered, throws an exception.
- Parameters
-
[in] | plugin_name | Name used to look up the constructor function used to create the object. |
- Returns
- A unique_ptr to the created object. The caller owns the created object.
◆ operator=()
◆ plugin_names()
Returns a list of all valid plugin names registered with the factory in the order they were registered.
- Returns
- List of valid plugin names.
◆ register_plugin()
template<class T >
void geopm::PluginFactory< T >::register_plugin |
( |
const std::string & |
plugin_name, |
|
|
std::function< std::unique_ptr< T >()> |
make_plugin, |
|
|
const std::map< std::string, std::string > & |
dictionary = m_empty_dictionary |
|
) |
| |
|
inline |
Add a plugin to the factory.
- Parameters
-
[in] | plugin_name | Name used to request plugins of the registered type. |
[in] | make_plugin | Function that returns a new object of the registered type. |
[in] | dictionary | Optional dictionary of static information about the registered type. |
The documentation for this class was generated from the following file: