gz/sim/components/Component.hh
Go to the documentation of this file.
Base class for all components.
Definition: gz/sim/components/Component.hh:231
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...
virtual void Deserialize(std::istream &_in)
Fills a component based on a stream with a serialized data. By default, it will do nothing....
Definition: gz/sim/components/Component.hh:262
BaseComponent()=default
Default constructor.
virtual void Serialize(std::ostream &_out) const
Fills a stream with a serialized version of the component. By default, it will leave the stream empty...
Definition: gz/sim/components/Component.hh:243
virtual std::unique_ptr< BaseComponent > Clone()=0
Clone the component.
virtual ~BaseComponent()=default
Default destructor.
Specialization for components that don't wrap any data. This class to be used to create simple compon...
Definition: gz/sim/components/Component.hh:405
static std::string typeName
Unique name for this component type. This is set through the Factory registration.
Definition: gz/sim/components/Component.hh:440
A component type that wraps any data type. The intention is for this class to be used to create simpl...
Definition: gz/sim/components/Component.hh:325
void Serialize(std::ostream &_out) const override
Fills a stream with a serialized version of the component. By default, it will leave the stream empty...
Definition: gz/sim/components/Component.hh:493
DataType Type
Alias for DataType.
Definition: gz/sim/components/Component.hh:327
static std::string typeName
Unique name for this component type. This is set through the Factory registration.
Definition: gz/sim/components/Component.hh:392
bool operator!=(const Component &_component) const
Inequality operator.
Definition: gz/sim/components/Component.hh:485
bool SetData(const DataType &_data, const std::function< bool(const DataType &, const DataType &)> &_eql)
Set the data of this component.
Definition: gz/sim/components/Component.hh:459
std::unique_ptr< BaseComponent > Clone() override
Clone the component.
Definition: gz/sim/components/Component.hh:510
static ComponentTypeId typeId
Unique ID for this component type. This is set through the Factory registration.
Definition: gz/sim/components/Component.hh:386
ComponentTypeId TypeId() const override
Returns the unique ID for the component's type. The ID is derived from the name that is manually chos...
Definition: gz/sim/components/Component.hh:519
void Deserialize(std::istream &_in) override
Fills a component based on a stream with a serialized data. By default, it will do nothing....
Definition: gz/sim/components/Component.hh:501
DataType & Data()
Get the mutable component data. This function will be deprecated in Gazebo 3, replaced by const DataT...
Definition: gz/sim/components/Component.hh:452
bool operator==(const Component &_component) const
Equality operator.
Definition: gz/sim/components/Component.hh:477
static std::ostream & Serialize(std::ostream &_out)
Definition: gz/sim/components/Component.hh:214
static std::istream & Deserialize(std::istream &_in)
Definition: gz/sim/components/Component.hh:220
Default serializer template to call stream operators only on types that support them....
Definition: gz/sim/components/Component.hh:109
static std::ostream & Serialize(std::ostream &_out, const DataType &_data)
Serialization.
Definition: gz/sim/components/Component.hh:111
static std::istream & Deserialize(std::istream &_in, DataType &_data)
Deserialization.
Definition: gz/sim/components/Component.hh:157
Type trait that determines if a operator>> is defined on Stream and DataType, i.e,...
Definition: gz/sim/components/Component.hh:87
Type trait that determines if a operator<< is defined on Stream and DataType, i.e,...
Definition: gz/sim/components/Component.hh:63
T endl(T... args)
std::add_lvalue_reference< void > NoData
Convenient type to be used by components that don't wrap any data. I.e. they act as tags and their pr...
Definition: gz/sim/components/Component.hh:206
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 namespace.