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 | |
bool | operator!= (const Component< NoData, Identifier > &) const |
Components with no data are always equal to another instance of the same type. More... | |
bool | operator== (const Component< NoData, Identifier > &) const |
Components with no data are always equal to another instance of the same type. More... | |
uint64_t | 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... | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const Component< NoData, Identifier > &) |
Components with no data are always serialize to an empty string. More... | |
std::istream & | operator>> (std::istream &_in, Component< NoData, Identifier > &) |
Components with no data are always serialize to an empty string. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from BaseComponent | |
virtual void | Deserialize (std::istream &) |
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... | |
virtual void | Serialize (std::ostream &) const |
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... | |
Detailed Description
template<typename Identifier>
class ignition::gazebo::components::Component< NoData, Identifier >
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
◆ operator!=()
Components with no data are always equal to another instance of the same type.
- Parameters
-
[in] _component Component to compare to
- Returns
- False.
◆ operator==()
Components with no data are always equal to another instance of the same type.
- Parameters
-
[in] _component Component to compare to
- Returns
- True.
◆ TypeId()
|
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 >::typeId.
Friends And Related Function Documentation
◆ operator<<
Components with no data are always serialize to an empty string.
- Parameters
-
[in] _out Out stream. [in] _component Component to stream
- Returns
- The same _out stream, unchanged.
◆ operator>>
Components with no data are always serialize to an empty string.
- Parameters
-
[in] _out In stream. [in] _component Component to stream
- Returns
- The same _in stream, unchanged.
Member Data Documentation
◆ typeId
|
inlinestatic |
Unique ID for this component type. This is set through the Factory registration.
The documentation for this class was generated from the following file: