registry Class Reference#
|
Reference API
|
gko::config::registry Class Referencefinal
#include <ginkgo/core/config/registry.hpp>
Public Member Functions | |
| registry (const configuration_map &additional_map={}) | |
| registry (const std::unordered_map< std::string, detail::allowed_ptr > &stored_map, const configuration_map &additional_map={}) | |
| template<typename T > | |
| bool | emplace (std::string key, std::shared_ptr< T > data) |
Protected Member Functions | |
| template<typename T > | |
| std::shared_ptr< T > | get_data (std::string key) const |
| const configuration_map & | get_build_map () const |
Detailed Description
This class stores additional context for creating Ginkgo objects from configuration files.
The context can contain user-provided objects that derive from the following base types:
- LinOp
- LinOpFactory
- CriterionFactory
Additionally, users can provide mappings from a configuration (provided as a pnode) to user-defined types that are derived from LinOpFactory
Constructor & Destructor Documentation
◆ registry() [1/2]
| gko::config::registry::registry | ( | const configuration_map & | additional_map = {} | ) |
registry constructor
- Parameters
-
additional_map the additional map to dispatch the class base. Users can extend the map to fit their own LinOpFactory. We suggest using "usr::" as the prefix in the key to simply avoid conflict with ginkgo's map.
◆ registry() [2/2]
| gko::config::registry::registry | ( | const std::unordered_map< std::string, detail::allowed_ptr > & | stored_map, |
| const configuration_map & | additional_map = {} |
||
| ) |
registry constructor
- Parameters
-
stored_map the map stores the shared pointer of users' objects. It can hold any type whose base type is LinOp/LinOpFactory/CriterionFactory. additional_map the additional map to dispatch the class base. Users can extend the map to fit their own LinOpFactory. We suggest using "usr::" as the prefix in the key to simply avoid conflict with ginkgo's map.
Member Function Documentation
◆ emplace()
template<typename T >
|
inline |
Store the data with the key.
- Template Parameters
-
T the type
- Parameters
-
key the unique key string data the shared pointer of the object
◆ get_build_map()
|
inlineprotected |
Get the stored build map
◆ get_data()
template<typename T >
|
inlineprotected |
Search the key on the corresponding map.
- Template Parameters
-
T the type
- Parameters
-
key the key string
- Returns
- the shared pointer of the object
The documentation for this class was generated from the following file:
- ginkgo/core/config/registry.hpp
Generated by