Factory.hh
Go to the documentation of this file.
std::map< ComponentTypeId, std::string > namesById
A list of IDs and their equivalent names.
Definition: Factory.hh:357
A base class for an object responsible for creating storages.
Definition: Factory.hh:82
std::vector< ComponentTypeId > TypeIds() const
Get all the registered component types by ID. return Vector of component IDs.
Definition: Factory.hh:313
T endl(T... args)
STL namespace.
bool HasType(ComponentTypeId _typeId)
Check if a component type has been registered. return True if registered.
Definition: Factory.hh:326
STL class.
std::unique_ptr< BaseComponent > Create() const override
Documentation inherited.
Definition: Factory.hh:67
A factory that generates a component based on a string type.
Definition: Factory.hh:114
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 anymore...
Definition: Factory.hh:209
void Unregister()
Unregister a component so that the factory can't create instances of the component anymore...
Definition: Factory.hh:196
std::unique_ptr< ComponentStorageBase > Create() const override
Create an instance of a storage that holds ComponentTypeT components.
Definition: Factory.hh:107
std::unique_ptr< components::BaseComponent > New(const ComponentTypeId &_type, const components::BaseComponent *_data)
Create a new instance of a component, initialized with particular data.
Definition: Factory.hh:276
constexpr uint64_t hash64(std::string_view _key)
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:362
uint64_t ComponentTypeId
A unique identifier for a component type. A component type must be derived from components::BaseCompo...
Definition: include/ignition/gazebo/Types.hh:90
T find(T... args)
std::unique_ptr< ComponentTypeT > New()
Create a new instance of a component.
Definition: Factory.hh:248
STL class.
STL class.
#define ignerr
#define IGN_DEPRECATED(version)
std::unique_ptr< components::BaseComponent > New(const ComponentTypeId &_type)
Create a new instance of a component.
Definition: Factory.hh:258
A base class for an object responsible for creating components.
Definition: Factory.hh:44
virtual std::unique_ptr< BaseComponent > Create(const components::BaseComponent *_data) const override
Documentation inherited.
Definition: Factory.hh:73
virtual ComponentTypeId TypeId() const =0
Returns the unique ID for the component's type. The ID is derived from the name that is manually chos...
This library is part of the Ignition Robotics project.
void Register(const std::string &_type, ComponentDescriptorBase *_compDesc)
Register a component so that the factory can create instances of the component based on an ID...
Definition: Factory.hh:140
A class for an object responsible for creating components.
Definition: Factory.hh:63
A class for an object responsible for creating storages.
Definition: Factory.hh:98
Base class for all components.
Definition: Component.hh:230
std::string Name(ComponentTypeId _typeId) const
Get a component's type name given its type ID. return Unique component name.
Definition: Factory.hh:333