gz/sim/components/Factory.hh
virtual ~ComponentDescriptorBase()=default
Destructor.
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:498
#define IGN_DEPRECATED(version)
This library is part of the Gazebo project.
STL class.
std::unique_ptr< ComponentTypeT > New()
Create a new instance of a component.
Definition: gz/sim/components/Factory.hh:393
std::uintptr_t id
Wrapped uintptr_t variable.
Definition: gz/sim/components/Factory.hh:140
void IGNITION_GAZEBO_HIDDEN Remove(RegistrationObjectId _regObjId)
Remove a component descriptor from the queue. This also deletes memory allocated for the component de...
Definition: gz/sim/components/Factory.hh:183
void Unregister(ComponentTypeId _typeId, RegistrationObjectId _regObjId)
Unregister a component so that the factory can't create instances of the component anymore.
Definition: gz/sim/components/Factory.hh:373
A class to hold the queue of component descriptors registered by translation units....
Definition: gz/sim/components/Factory.hh:158
std::map< ComponentTypeId, std::string > namesById
A list of IDs and their equivalent names.
Definition: gz/sim/components/Factory.hh:493
void Unregister()
Unregister a component so that the factory can't create instances of the component anymore.
Definition: gz/sim/components/Factory.hh:335
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:481
STL class.
T find_if(T... args)
void Unregister(ComponentTypeId _typeId)
Unregister a component so that the factory can't create instances of the component anymore.
Definition: gz/sim/components/Factory.hh:359
IGNITION_GAZEBO_HIDDEN std::unique_ptr< BaseComponent > Create() const
Create a component using the latest available component descriptor. This simply forward to ComponentD...
Definition: gz/sim/components/Factory.hh:200
RegistrationObjectId(std::uintptr_t _ptrAddress)
Construct object from a uintptr_t.
Definition: gz/sim/components/Factory.hh:127
void Register(const std::string &_type, ComponentDescriptorBase *_compDesc, RegistrationObjectId _regObjId)
Register a component so that the factory can create instances of the component based on an ID.
Definition: gz/sim/components/Factory.hh:284
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:109
void Unregister(RegistrationObjectId _regObjId)
Unregister a component so that the factory can't create instances of the component anymore.
Definition: gz/sim/components/Factory.hh:347
A factory that generates a component based on a string type.
Definition: gz/sim/components/Factory.hh:230
std::unique_ptr< ComponentStorageBase > NewStorage(const ComponentTypeId &)
Create a new instance of a component storage.
Definition: gz/sim/components/Factory.hh:453
#define ignerr
T push_back(T... args)
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: gz/sim/components/Factory.hh:422
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...
A base class for an object responsible for creating components.
Definition: gz/sim/components/Factory.hh:46
StorageDescriptor()=default
Constructor.
T at(T... args)
bool operator==(const RegistrationObjectId &_other) const
Equality comparison.
Definition: gz/sim/components/Factory.hh:134
A class for an object responsible for creating components.
Definition: gz/sim/components/Factory.hh:65
Factory()=default
virtual std::unique_ptr< BaseComponent > Create(const components::BaseComponent *_data) const override
Documentation inherited.
Definition: gz/sim/components/Factory.hh:75
STL class.
Base class for all components.
Definition: gz/sim/components/Component.hh:230
RegistrationObjectId(void *_ptr)
Construct object from a pointer.
Definition: gz/sim/components/Factory.hh:120
std::unique_ptr< BaseComponent > Create() const override
Documentation inherited.
Definition: gz/sim/components/Factory.hh:69
STL class.
IGNITION_GAZEBO_HIDDEN std::unique_ptr< BaseComponent > Create(const components::BaseComponent *_data) const
Create a component using the latest available component descriptor. This simply forward to ComponentD...
Definition: gz/sim/components/Factory.hh:212
std::unique_ptr< components::BaseComponent > New(const ComponentTypeId &_type)
Create a new instance of a component.
Definition: gz/sim/components/Factory.hh:403
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:474
StorageDescriptorBase()=default
Constructor.
static Factory * Instance()
Get an instance of the singleton.
STL namespace.
A wrapper around uintptr_t to prevent implicit conversions.
Definition: gz/sim/components/Factory.hh:116
bool IGNITION_GAZEBO_HIDDEN Empty()
Check if the queue is empty.
Definition: gz/sim/components/Factory.hh:161
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: gz/sim/components/Factory.hh:268
std::vector< ComponentTypeId > TypeIds() const
Get all the registered component types by ID. return Vector of component IDs.
Definition: gz/sim/components/Factory.hh:461
T end(T... args)
T prev(T... args)
A base class for an object responsible for creating storages.
Definition: gz/sim/components/Factory.hh:84
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:90
STL class.
void Register(const std::string &_type, ComponentDescriptorBase *_compDesc, StorageDescriptorBase *)
Register a component so that the factory can create instances of the component and its storage based ...
Definition: gz/sim/components/Factory.hh:253
virtual std::unique_ptr< ComponentStorageBase > Create() const =0
Create an instance of a storage.
void IGNITION_GAZEBO_HIDDEN Add(RegistrationObjectId _regObjId, ComponentDescriptorBase *_comp)
Add a component descriptor to the queue.
Definition: gz/sim/components/Factory.hh:171
A class for an object responsible for creating storages.
Definition: gz/sim/components/Factory.hh:100