Factory.hh
Go to the documentation of this file.
std::unique_ptr< ComponentStorageBase > NewStorage(const ComponentTypeId &_typeId)
Create a new instance of a component storage.
Definition: Factory.hh:252
static std::map< ComponentTypeId, std::string > namesById
A list of IDs and their equivalent names. Make it non-static on version 2.0.
Definition: Factory.hh:314
A base class for an object responsible for creating storages.
Definition: Factory.hh:69
std::vector< ComponentTypeId > TypeIds() const
Get all the registered component types by ID. return Vector of component IDs.
Definition: Factory.hh:265
T endl(T... args)
void Register(const std::string &_type, ComponentDescriptorBase *_compDesc, StorageDescriptorBase *_storageDesc)
Register a component so that the factory can create instances of the component and its storage based ...
Definition: Factory.hh:107
bool HasType(ComponentTypeId _typeId)
Check if a component type has been registered. return True if registered.
Definition: Factory.hh:278
STL class.
std::unique_ptr< BaseComponent > Create() const override
Create an instance of a ComponentTypeT Component.
Definition: Factory.hh:62
A factory that generates a component based on a string type.
Definition: Factory.hh:95
STL class.
bool env(const std::string &_name, std::string &_value)
T at(T... args)
T push_back(T... args)
void Unregister(ComponentTypeId _typeId)
Unregister a component so that the factory can't create instances of the component or its storage any...
Definition: Factory.hh:178
void Unregister()
Unregister a component so that the factory can't create instances of the component or its storage any...
Definition: Factory.hh:165
std::unique_ptr< ComponentStorageBase > Create() const override
Create an instance of a storage that holds ComponentTypeT components.
Definition: Factory.hh:88
constexpr uint64_t hash64(std::string_view _key)
static std::map< ComponentTypeId, std::string > runtimeNamesById
Keep track of the runtime names for types and warn the user if they try to register different types w...
Definition: Factory.hh:320
uint64_t ComponentTypeId
A unique identifier for a component type. A component type must be derived from components::BaseCompo...
Definition: Types.hh:86
T find(T... args)
std::unique_ptr< ComponentTypeT > New()
Create a new instance of a component.
Definition: Factory.hh:226
STL class.
STL class.
std::unique_ptr< components::BaseComponent > New(const ComponentTypeId &_type)
Create a new instance of a component.
Definition: Factory.hh:236
A base class for an object responsible for creating components.
Definition: Factory.hh:44
This library is part of the Ignition Robotics project.
A class for an object responsible for creating components.
Definition: Factory.hh:57
A class for an object responsible for creating storages.
Definition: Factory.hh:82
std::string Name(ComponentTypeId _typeId) const
Get a component's type name given its type ID. return Unique component name.
Definition: Factory.hh:285