Gazebo Gazebo

API Reference

3.15.1
ComponentToMsgSerializer< DataType, MsgType > Class Template Reference

Serialization for that converts components data types to gz::msgs. This assumes that gz::sim::convert<DataType> is defined. More...

#include <Serialization.hh>

Static Public Member Functions

static std::istreamDeserialize (std::istream &_in, DataType &_data)
 Deserialization. More...
 
static std::ostreamSerialize (std::ostream &_out, const DataType &_data)
 Serialization. More...
 

Detailed Description

template<typename DataType, typename MsgType>
class ignition::gazebo::serializers::ComponentToMsgSerializer< DataType, MsgType >

Serialization for that converts components data types to gz::msgs. This assumes that gz::sim::convert<DataType> is defined.

Template Parameters
DataTypeUnderlying data type of the component

This can be used for components that can be converted to gz::msg types via gz::sim::convert. For example sdf::Geometry can be converted to msgs::Geometry so the component can be defined as

using Geometry = Component<sdf::Geometry, class GeometryTag,
ComponentToMsgSerializer<sdf::Geometry, msgs::Geometry>>

Member Function Documentation

◆ Deserialize()

static std::istream& Deserialize ( std::istream _in,
DataType &  _data 
)
inlinestatic

Deserialization.

Parameters
[in]_inInput stream.
[out]_datadata to populate
Returns
The stream.

◆ Serialize()

static std::ostream& Serialize ( std::ostream _out,
const DataType &  _data 
)
inlinestatic

Serialization.

Parameters
[in]_outOutput stream.
[in]_datadata to stream
Returns
The stream.

The documentation for this class was generated from the following file:
Component< sdf::Geometry, class GeometryTag, serializers::GeometrySerializer > Geometry
This component holds an entity's geometry.
Definition: gz/sim/components/Geometry.hh:46