Ignition Gazebo

API Reference

6.1.0
Component< NoData, Identifier, Serializer > Class Template Reference

Specialization for components that don't wrap any data. This class to be used to create simple components that represent just a "tag", while avoiding a lot of boilerplate code. The Identifier must be a unique type so that type aliases can be used to create new components. However the type does not need to be defined anywhere eg. More...

#include <Component.hh>

Public Member Functions

std::unique_ptr< BaseComponentClone () override
 Clone the component. More...
 
void Deserialize (std::istream &_in) override
 Fills a component based on a stream with a serialized data. By default, it will do nothing. Derived classes should override this function to support deserialization. More...
 
bool operator!= (const Component< NoData, Identifier, Serializer > &_component) const
 Components with no data are always equal to another instance of the same type. More...
 
bool operator== (const Component< NoData, Identifier, Serializer > &_component) const
 Components with no data are always equal to another instance of the same type. More...
 
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. Derived classes should override this function to support serialization. More...
 
ComponentTypeId TypeId () const override
 Returns the unique ID for the component's type. The ID is derived from the name that is manually chosen during the Factory registration and is guaranteed to be the same across compilers and runs. More...
 
- Public Member Functions inherited from BaseComponent
 BaseComponent ()=default
 Default constructor. More...
 
virtual ~BaseComponent ()=default
 Default destructor. More...
 

Static Public Attributes

static ComponentTypeId typeId {0}
 Unique ID for this component type. This is set through the Factory registration. More...
 
static std::string typeName
 Unique name for this component type. This is set through the Factory registration. More...
 

Detailed Description

template<typename Identifier, typename Serializer>
class ignition::gazebo::components::Component< NoData, Identifier, Serializer >

Specialization for components that don't wrap any data. This class to be used to create simple components that represent just a "tag", while avoiding a lot of boilerplate code. The Identifier must be a unique type so that type aliases can be used to create new components. However the type does not need to be defined anywhere eg.

using Joint = Component<NoData, class JointTag>;

Member Function Documentation

◆ Clone()

std::unique_ptr< BaseComponent > Clone ( )
overridevirtual

Clone the component.

Returns
A pointer to the component.

Implements BaseComponent.

◆ Deserialize()

void Deserialize ( std::istream _in)
overridevirtual

Fills a component based on a stream with a serialized data. By default, it will do nothing. Derived classes should override this function to support deserialization.

Parameters
[in]_inIn stream.

Reimplemented from BaseComponent.

◆ operator!=()

bool operator!= ( const Component< NoData, Identifier, Serializer > &  _component) const

Components with no data are always equal to another instance of the same type.

Parameters
[in]_componentComponent to compare to
Returns
False.

◆ operator==()

bool operator== ( const Component< NoData, Identifier, Serializer > &  _component) const

Components with no data are always equal to another instance of the same type.

Parameters
[in]_componentComponent to compare to
Returns
True.

◆ Serialize()

void Serialize ( std::ostream _out) const
overridevirtual

Fills a stream with a serialized version of the component. By default, it will leave the stream empty. Derived classes should override this function to support serialization.

Parameters
[in]_outOut stream.

Reimplemented from BaseComponent.

◆ TypeId()

ComponentTypeId TypeId ( ) const
overridevirtual

Returns the unique ID for the component's type. The ID is derived from the name that is manually chosen during the Factory registration and is guaranteed to be the same across compilers and runs.

Implements BaseComponent.

References Component< DataType, Identifier, Serializer >::typeId.

Member Data Documentation

◆ typeId

ComponentTypeId typeId {0}
inlinestatic

Unique ID for this component type. This is set through the Factory registration.

◆ typeName

std::string typeName
inlinestatic

Unique name for this component type. This is set through the Factory registration.


The documentation for this class was generated from the following file: