gz/sim/components/Factory.hh
virtual ~ComponentDescriptorBase()=default
Destructor.
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: gz/sim/components/Factory.hh:320
This library is part of the Ignition Robotics project.
STL class.
std::unique_ptr< ComponentTypeT > New()
Create a new instance of a component.
Definition: gz/sim/components/Factory.hh:226
static std::map< ComponentTypeId, std::string > namesById
A list of IDs and their equivalent names.
Definition: gz/sim/components/Factory.hh:314
void Unregister()
Unregister a component so that the factory can't create instances of the component or its storage any...
Definition: gz/sim/components/Factory.hh:165
std::string Name(ComponentTypeId _typeId) const
Get a component's type name given its type ID. return Unique component name.
Definition: gz/sim/components/Factory.hh:285
STL class.
T find(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: gz/sim/components/Factory.hh:178
virtual std::unique_ptr< BaseComponent > Create() const =0
Create an instance of a Component.
std::unique_ptr< ComponentStorageBase > Create() const override
Create an instance of a storage that holds ComponentTypeT components.
Definition: gz/sim/components/Factory.hh:88
A factory that generates a component based on a string type.
Definition: gz/sim/components/Factory.hh:95
T push_back(T... args)
A base class for an object responsible for creating components.
Definition: gz/sim/components/Factory.hh:44
T at(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: gz/sim/components/Factory.hh:107
A class for an object responsible for creating components.
Definition: gz/sim/components/Factory.hh:57
T erase(T... args)
std::unique_ptr< BaseComponent > Create() const override
Create an instance of a ComponentTypeT Component.
Definition: gz/sim/components/Factory.hh:62
STL class.
std::unique_ptr< components::BaseComponent > New(const ComponentTypeId &_type)
Create a new instance of a component.
Definition: gz/sim/components/Factory.hh:236
virtual ~StorageDescriptorBase()=default
Destructor.
T endl(T... args)
bool HasType(ComponentTypeId _typeId)
Check if a component type has been registered. return True if registered.
Definition: gz/sim/components/Factory.hh:278
std::unique_ptr< ComponentStorageBase > NewStorage(const ComponentTypeId &_typeId)
Create a new instance of a component storage.
Definition: gz/sim/components/Factory.hh:252
std::vector< ComponentTypeId > TypeIds() const
Get all the registered component types by ID. return Vector of component IDs.
Definition: gz/sim/components/Factory.hh:265
T end(T... args)
A base class for an object responsible for creating storages.
Definition: gz/sim/components/Factory.hh:69
uint64_t ComponentTypeId
A unique identifier for a component type. A component type must be derived from components::BaseCompo...
Definition: include/gz/sim/Types.hh:87
STL class.
virtual std::unique_ptr< ComponentStorageBase > Create() const =0
Create an instance of a storage.
A class for an object responsible for creating storages.
Definition: gz/sim/components/Factory.hh:82