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:499
#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:394
std::uintptr_t id
Wrapped uintptr_t variable.
Definition: gz/sim/components/Factory.hh:141
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:184
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:374
A class to hold the queue of component descriptors registered by translation units....
Definition: gz/sim/components/Factory.hh:159
std::map< ComponentTypeId, std::string > namesById
A list of IDs and their equivalent names.
Definition: gz/sim/components/Factory.hh:494
void Unregister()
Unregister a component so that the factory can't create instances of the component anymore.
Definition: gz/sim/components/Factory.hh:336
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:482
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:360
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:201
RegistrationObjectId(std::uintptr_t _ptrAddress)
Construct object from a uintptr_t.
Definition: gz/sim/components/Factory.hh:128
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:285
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:110
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:348
A factory that generates a component based on a string type.
Definition: gz/sim/components/Factory.hh:231
std::unique_ptr< ComponentStorageBase > NewStorage(const ComponentTypeId &)
Create a new instance of a component storage.
Definition: gz/sim/components/Factory.hh:454
#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:423
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:47
StorageDescriptor()=default
Constructor.
T at(T... args)
bool operator==(const RegistrationObjectId &_other) const
Equality comparison.
Definition: gz/sim/components/Factory.hh:135
A class for an object responsible for creating components.
Definition: gz/sim/components/Factory.hh:66
Factory()=default
virtual std::unique_ptr< BaseComponent > Create(const components::BaseComponent *_data) const override
Documentation inherited.
Definition: gz/sim/components/Factory.hh:76
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:121
std::unique_ptr< BaseComponent > Create() const override
Documentation inherited.
Definition: gz/sim/components/Factory.hh:70
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:213
std::unique_ptr< components::BaseComponent > New(const ComponentTypeId &_type)
Create a new instance of a component.
Definition: gz/sim/components/Factory.hh:404
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:475
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:117
bool IGNITION_GAZEBO_HIDDEN Empty()
Check if the queue is empty.
Definition: gz/sim/components/Factory.hh:162
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:269
std::vector< ComponentTypeId > TypeIds() const
Get all the registered component types by ID. return Vector of component IDs.
Definition: gz/sim/components/Factory.hh:462
T end(T... args)
T prev(T... args)
A base class for an object responsible for creating storages.
Definition: gz/sim/components/Factory.hh:85
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:254
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:172
A class for an object responsible for creating storages.
Definition: gz/sim/components/Factory.hh:101