Template Class CSerdes#

Class Documentation#

template<typename T>
class CSerdes#

Serializer/deserializer class.

Template Parameters:

T – Type of the variable.

Public Static Functions

static void CalcSize(const T &rtValue, size_t &rnSize)#

Calculate the size of the value in serialized form.

Remark

Dependable on the size value, padding is added to align data.

Parameters:
  • rtValue[in] Reference to the variable.

  • rnSize[inout] Reference to the variable containing the current size and increased by the size of the value.

template<sdv::EEndian eTargetEndianess, typename TCRC>
static sdv::serializer<eTargetEndianess, TCRC> &Serialize(sdv::serializer<eTargetEndianess, TCRC> &rSerializer, const T &rtValue)#

Stream the variable into the serializer.

Template Parameters:
  • eTargetEndianess – The target endianness determines whether to swap the bytes before storing them into the buffer.

  • TCRC – The CRC type to use for the checksum calculation.

Parameters:
  • rSerializer[in] Reference to the serializer.

  • rtValue[in] Reference to the variable.

Returns:

Reference to the serializer.

template<sdv::EEndian eSourceEndianess, typename TCRC>
static sdv::deserializer<eSourceEndianess, TCRC> &Deserialize(sdv::deserializer<eSourceEndianess, TCRC> &rDeserializer, T &rtValue)#

Stream a variable from the deserializer.

Template Parameters:
  • eSourceEndianess – The target endianness determines whether to swap the bytes before storing them into the buffer.

  • TCRC – The CRC type to use for the checksum calculation.

Parameters:
  • rDeserializer[in] Reference to the deserializer.

  • rtValue[out] Reference to the variable to be filled.

Returns:

Reference to the deserializer.