|
SILICON
|
#include <component_registry.hpp>
Classes | |
| struct | Entry |
Public Types | |
| using | Factory = std::function<Component_ptr()> |
| using | ComponentCategory = SILICON::core::ComponentCategory |
| using | ComponentMetadata = SILICON::core::ComponentMetadata |
Public Member Functions | |
| ComponentRegistry () | |
| void | registerType (std::string type, Factory factory) |
| Component_ptr | create (std::string_view type) const |
| bool | hasType (std::string_view type) const |
| ComponentMetadata | metadata (std::string_view type) const |
| std::vector< std::string > | availableTypes () const |
Static Public Member Functions | |
| static ComponentRegistry | empty () |
| static ComponentRegistry & | instance () |
Private Attributes | |
| std::map< std::string, Entry, std::less<> > | types |
Definition at line 35 of file component_registry.hpp.
Definition at line 38 of file component_registry.hpp.
Definition at line 39 of file component_registry.hpp.
| using Factory = std::function<Component_ptr()> |
Definition at line 37 of file component_registry.hpp.
|
default |
| std::vector< std::string > availableTypes | ( | ) | const |
Definition at line 87 of file component_registry.cpp.
| Component_ptr create | ( | std::string_view | type | ) | const |
Definition at line 64 of file component_registry.cpp.
|
static |
Definition at line 29 of file component_registry.cpp.
| bool hasType | ( | std::string_view | type | ) | const |
Definition at line 73 of file component_registry.cpp.
|
static |
Definition at line 34 of file component_registry.cpp.
| ComponentMetadata metadata | ( | std::string_view | type | ) | const |
Definition at line 78 of file component_registry.cpp.
| void registerType | ( | std::string | type, |
| Factory | factory ) |
Definition at line 49 of file component_registry.cpp.
|
private |
Definition at line 56 of file component_registry.hpp.