SILICON
Loading...
Searching...
No Matches
ComponentRegistry Class Reference

#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

Detailed Description

Definition at line 35 of file component_registry.hpp.

Member Typedef Documentation

◆ ComponentCategory

◆ ComponentMetadata

◆ Factory

using Factory = std::function<Component_ptr()>

Definition at line 37 of file component_registry.hpp.

Constructor & Destructor Documentation

◆ ComponentRegistry()

ComponentRegistry ( )
default

Member Function Documentation

◆ availableTypes()

std::vector< std::string > availableTypes ( ) const

Definition at line 87 of file component_registry.cpp.

◆ create()

Component_ptr create ( std::string_view type) const

Definition at line 64 of file component_registry.cpp.

◆ empty()

ComponentRegistry empty ( )
static

Definition at line 29 of file component_registry.cpp.

◆ hasType()

bool hasType ( std::string_view type) const

Definition at line 73 of file component_registry.cpp.

◆ instance()

ComponentRegistry & instance ( )
static

Definition at line 34 of file component_registry.cpp.

◆ metadata()

ComponentMetadata metadata ( std::string_view type) const

Definition at line 78 of file component_registry.cpp.

◆ registerType()

void registerType ( std::string type,
Factory factory )

Definition at line 49 of file component_registry.cpp.

Member Data Documentation

◆ types

std::map<std::string, Entry, std::less<> > types
private

Definition at line 56 of file component_registry.hpp.


The documentation for this class was generated from the following files: