F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Fw::SerialBufferBase Class Referenceabstract

#include <Fw/Types/Serializable.hpp>

Inheritance diagram for Fw::SerialBufferBase:
Fw::LinearBufferBase Drv::DataBuffer Fw::ActiveComponentExitSerializableBuffer Fw::CmdArgBuffer Fw::ComBuffer Fw::ExternalSerializeBuffer Fw::LogBuffer Fw::ParamBuffer Fw::SerialBuffer Fw::SmSignalBuffer Fw::StatementArgBuffer Fw::TlmBuffer Utils::HashBuffer

Public Member Functions

virtual ~SerialBufferBase ()
 Virtual destructor. More...
 
virtual SerializeStatus serializeFrom (U8 val, Endianness mode=Endianness::BIG)=0
 Serialize an 8-bit unsigned integer value. More...
 
virtual SerializeStatus serializeFrom (I8 val, Endianness mode=Endianness::BIG)=0
 Serialize an 8-bit signed integer value. More...
 
virtual SerializeStatus serializeFrom (F32 val, Endianness mode=Endianness::BIG)=0
 Serialize a 32-bit floating point value. More...
 
virtual SerializeStatus serializeFrom (F64 val, Endianness mode=Endianness::BIG)=0
 Serialize a 64-bit floating point value. More...
 
virtual SerializeStatus serializeFrom (bool val, Endianness mode=Endianness::BIG)=0
 Serialize a boolean value. More...
 
virtual SerializeStatus serializeFrom (const void *val, Endianness mode=Endianness::BIG)=0
 Serialize a pointer value. More...
 
virtual SerializeStatus serializeFrom (const U8 *buff, FwSizeType length, Endianness endianMode=Endianness::BIG)=0
 Serialize a data buffer. More...
 
virtual SerializeStatus serializeFrom (const U8 *buff, FwSizeType length, Serialization::t lengthMode, Endianness endianMode=Endianness::BIG)=0
 Serialize a byte buffer with optional length prefix. More...
 
virtual SerializeStatus serializeFrom (const LinearBufferBase &val, Endianness mode=Endianness::BIG)=0
 Serialize another LinearBufferBase object. More...
 
virtual SerializeStatus serializeFrom (const Serializable &val, Endianness mode=Endianness::BIG)=0
 Serialize a Serializable object. More...
 
virtual SerializeStatus serializeSize (const FwSizeType size, Endianness mode=Endianness::BIG)=0
 Serialize a size value. More...
 
virtual SerializeStatus deserializeTo (U8 &val, Endianness mode=Endianness::BIG)=0
 Deserialize an 8-bit unsigned integer value. More...
 
virtual SerializeStatus deserializeTo (I8 &val, Endianness mode=Endianness::BIG)=0
 Deserialize an 8-bit signed integer value. More...
 
virtual SerializeStatus deserializeTo (F32 &val, Endianness mode=Endianness::BIG)=0
 Deserialize a 32-bit floating point value. More...
 
virtual SerializeStatus deserializeTo (F64 &val, Endianness mode=Endianness::BIG)=0
 Deserialize a 64-bit floating point value. More...
 
virtual SerializeStatus deserializeTo (bool &val, Endianness mode=Endianness::BIG)=0
 Deserialize a boolean value. More...
 
virtual SerializeStatus deserializeTo (void *&val, Endianness mode=Endianness::BIG)=0
 Deserialize a pointer value. More...
 
virtual SerializeStatus deserializeTo (U8 *buff, FwSizeType &length, Endianness endianMode=Endianness::BIG)=0
 Deserialize a data buffer. More...
 
virtual SerializeStatus deserializeTo (U8 *buff, FwSizeType &length, Serialization::t lengthMode, Endianness endianMode=Endianness::BIG)=0
 Deserialize a byte buffer with optional length prefix. More...
 
virtual SerializeStatus deserializeTo (Serializable &val, Endianness mode=Endianness::BIG)=0
 Deserialize a Serializable object. More...
 
virtual SerializeStatus deserializeTo (LinearBufferBase &val, Endianness mode=Endianness::BIG)=0
 Deserialize a LinearBufferBase object. More...
 
virtual SerializeStatus deserializeSize (FwSizeType &size, Endianness mode=Endianness::BIG)=0
 Deserialize a size value. More...
 
virtual SerializeStatus copyRaw (SerialBufferBase &dest, Serializable::SizeType size)=0
 Copy raw bytes from the source (this) into a destination buffer and advance source offset. More...
 
virtual SerializeStatus copyRawOffset (SerialBufferBase &dest, Serializable::SizeType size)=0
 Append raw bytes to destination (no length) and advance source offset. More...
 
virtual void resetSer ()=0
 Reset serialization pointer to beginning of buffer. More...
 
virtual void resetDeser ()=0
 Reset deserialization pointer to beginning of buffer. More...
 
virtual SerializeStatus moveSerToOffset (FwSizeType offset)=0
 Move serialization pointer to specified offset. More...
 
virtual SerializeStatus moveDeserToOffset (FwSizeType offset)=0
 Move deserialization pointer to specified offset. More...
 
virtual SerializeStatus serializeSkip (FwSizeType numBytesToSkip)=0
 Skip specified number of bytes during serialization. More...
 
virtual SerializeStatus deserializeSkip (FwSizeType numBytesToSkip)=0
 Skip specified number of bytes during deserialization. More...
 
virtual Serializable::SizeType getCapacity () const =0
 Get buffer capacity. More...
 
virtual Serializable::SizeType getSize () const =0
 Get current buffer size. More...
 
virtual Serializable::SizeType getDeserializeSizeLeft () const =0
 Get remaining deserialization buffer size. More...
 
virtual Serializable::SizeType getSerializeSizeLeft () const =0
 Get remaining serialization buffer size. More...
 
virtual SerializeStatus setBuff (const U8 *src, Serializable::SizeType length)=0
 Set buffer contents from external source. More...
 
virtual SerializeStatus setBuffLen (Serializable::SizeType length)=0
 Set buffer length manually. More...
 

Detailed Description

Definition at line 112 of file Serializable.hpp.

Constructor & Destructor Documentation

◆ ~SerialBufferBase()

Fw::SerialBufferBase::~SerialBufferBase ( )
virtual

Virtual destructor.

Ensures proper cleanup of derived classes.

Definition at line 40 of file Serializable.cpp.

Member Function Documentation

◆ copyRaw()

virtual SerializeStatus Fw::SerialBufferBase::copyRaw ( SerialBufferBase dest,
Serializable::SizeType  size 
)
pure virtual

Copy raw bytes from the source (this) into a destination buffer and advance source offset.

Copies exactly size bytes starting at the current deserialization pointer of this into dest. This operation does not prepend a length field and does not interpret the data.

Preconditions:

  • size bytes must remain in the source (getDeserializeSizeLeft() >= size).
  • Destination must have sufficient capacity (dest.getCapacity() >= size).

Post-conditions on success:

  • dest contains exactly the copied bytes and its previous contents are discarded.
  • this has advanced its deserialization pointer by size bytes.
Parameters
destDestination serialization buffer to receive the bytes (its contents are replaced)
sizeNumber of bytes to copy from the source
Returns
FW_SERIALIZE_OK on success; FW_SERIALIZE_NO_ROOM_LEFT if destination capacity is insufficient; FW_DESERIALIZE_SIZE_MISMATCH if source does not contain size bytes remaining

Implemented in Fw::LinearBufferBase.

◆ copyRawOffset()

virtual SerializeStatus Fw::SerialBufferBase::copyRawOffset ( SerialBufferBase dest,
Serializable::SizeType  size 
)
pure virtual

Append raw bytes to destination (no length) and advance source offset.

Appends exactly size bytes from the current deserialization pointer of this into dest using Serialization::OMIT_LENGTH, preserving any existing bytes already serialized in dest.

Preconditions:

  • size bytes must remain in the source (getDeserializeSizeLeft() >= size).
  • Destination must have space for the append (dest.getCapacity() >= dest.getSize() + size).

Post-conditions on success:

  • dest gains size additional bytes at the end; no length token is written.
  • this has advanced its deserialization pointer by size bytes.
Parameters
destDestination serialization buffer to append to
sizeNumber of bytes to copy from the source and append to dest
Returns
FW_SERIALIZE_OK on success; FW_SERIALIZE_NO_ROOM_LEFT if destination capacity is insufficient; FW_DESERIALIZE_SIZE_MISMATCH if source does not contain size bytes remaining

Implemented in Fw::LinearBufferBase.

◆ deserializeSize()

virtual SerializeStatus Fw::SerialBufferBase::deserializeSize ( FwSizeType size,
Endianness  mode = Endianness::BIG 
)
pure virtual

Deserialize a size value.

This method reads a size value (typically used for buffer sizes) from the deserialization buffer. The endianness of the deserialization can be controlled via the mode parameter.

Parameters
sizeReference to store the deserialized size value
modeEndianness mode for deserialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ deserializeSkip()

virtual SerializeStatus Fw::SerialBufferBase::deserializeSkip ( FwSizeType  numBytesToSkip)
pure virtual

Skip specified number of bytes during deserialization.

This method advances the deserialization pointer by the specified number of bytes without reading any data. This can be used to skip over data in the buffer that is not needed or to advance to the next relevant data segment.

Parameters
numBytesToSkipNumber of bytes to skip during deserialization
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ deserializeTo() [1/10]

virtual SerializeStatus Fw::SerialBufferBase::deserializeTo ( U8 val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Deserialize an 8-bit unsigned integer value.

This method reads an 8-bit unsigned integer value from the deserialization buffer and stores it in the provided reference. The endianness of the deserialization can be controlled via the mode parameter.

Parameters
valReference to store the deserialized 8-bit unsigned integer value
modeEndianness mode for deserialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ deserializeTo() [2/10]

virtual SerializeStatus Fw::SerialBufferBase::deserializeTo ( I8 val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Deserialize an 8-bit signed integer value.

This method reads an 8-bit signed integer value from the deserialization buffer and stores it in the provided reference. The endianness of the deserialization can be controlled via the mode parameter.

Parameters
valReference to store the deserialized 8-bit signed integer value
modeEndianness mode for deserialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ deserializeTo() [3/10]

virtual SerializeStatus Fw::SerialBufferBase::deserializeTo ( F32 val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Deserialize a 32-bit floating point value.

This method reads a 32-bit floating point value from the deserialization buffer and stores it in the provided reference. The endianness of the deserialization can be controlled via the mode parameter.

Parameters
valReference to store the deserialized 32-bit floating point value
modeEndianness mode for deserialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ deserializeTo() [4/10]

virtual SerializeStatus Fw::SerialBufferBase::deserializeTo ( F64 val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Deserialize a 64-bit floating point value.

This method reads a 64-bit floating point value from the deserialization buffer and stores it in the provided reference. The endianness of the deserialization can be controlled via the mode parameter.

Parameters
valReference to store the deserialized 64-bit floating point value
modeEndianness mode for deserialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ deserializeTo() [5/10]

virtual SerializeStatus Fw::SerialBufferBase::deserializeTo ( bool &  val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Deserialize a boolean value.

This method reads a boolean value from the deserialization buffer and stores it in the provided reference. The endianness of the deserialization can be controlled via the mode parameter.

Parameters
valReference to store the deserialized boolean value
modeEndianness mode for deserialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ deserializeTo() [6/10]

virtual SerializeStatus Fw::SerialBufferBase::deserializeTo ( void *&  val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Deserialize a pointer value.

This method reads a pointer value from the deserialization buffer and stores it in the provided reference. Note that only the pointer value itself is deserialized, not the contents it points to. The endianness of the deserialization can be controlled via the mode parameter.

Parameters
valReference to store the deserialized pointer value
modeEndianness mode for deserialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ deserializeTo() [7/10]

virtual SerializeStatus Fw::SerialBufferBase::deserializeTo ( U8 buff,
FwSizeType length,
Endianness  endianMode = Endianness::BIG 
)
pure virtual

Deserialize a data buffer.

This method reads a buffer of bytes from the deserialization buffer and stores them in the provided buffer. The endianness of the deserialization can be controlled via the endianMode parameter.

Parameters
buffPointer to the buffer where deserialized data will be stored
lengthReference to store the actual number of bytes deserialized
endianModeEndianness mode for deserialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ deserializeTo() [8/10]

virtual SerializeStatus Fw::SerialBufferBase::deserializeTo ( U8 buff,
FwSizeType length,
Serialization::t  lengthMode,
Endianness  endianMode = Endianness::BIG 
)
pure virtual

Deserialize a byte buffer with optional length prefix.

This method reads a buffer of bytes from the deserialization buffer and stores them in the provided buffer. If lengthMode indicates that a length prefix was included, it will be read from the buffer first. The endianness of the deserialization can be controlled via the endianMode parameter.

Parameters
buffPointer to the buffer where deserialized data will be stored
lengthReference to store the actual number of bytes deserialized
lengthModeSpecifies whether length was included in serialization (INCLUDE_LENGTH or OMIT_LENGTH)
endianModeEndianness mode for deserialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ deserializeTo() [9/10]

virtual SerializeStatus Fw::SerialBufferBase::deserializeTo ( Serializable val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Deserialize a Serializable object.

This method reads data from the deserialization buffer and reconstructs a Serializable object from it. The endianness of the deserialization can be controlled via the mode parameter.

Parameters
valReference to the Serializable object that will be populated with deserialized data
modeEndianness mode for deserialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ deserializeTo() [10/10]

virtual SerializeStatus Fw::SerialBufferBase::deserializeTo ( LinearBufferBase val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Deserialize a LinearBufferBase object.

This method reads data from the deserialization buffer and reconstructs a LinearBufferBase object from it. The endianness of the deserialization can be controlled via the mode parameter.

Parameters
valReference to the LinearBufferBase object that will be populated with deserialized data
modeEndianness mode for deserialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ getCapacity()

virtual Serializable::SizeType Fw::SerialBufferBase::getCapacity ( ) const
pure virtual

Get buffer capacity.

This method returns the total capacity of the buffer, which is the maximum amount of data that can be stored in the buffer. This is not the same as the current size, which indicates how much data is currently in the buffer.

Returns
The capacity of the buffer in bytes

Implemented in Fw::ExternalSerializeBuffer, Fw::LinearBufferBase, Utils::HashBuffer, Fw::SerialBuffer, Fw::ParamBuffer, Fw::CmdArgBuffer, Fw::ComBuffer, Fw::LogBuffer, Fw::SmSignalBuffer, Fw::TlmBuffer, Drv::DataBuffer, Fw::StatementArgBuffer, and Fw::ActiveComponentExitSerializableBuffer.

◆ getDeserializeSizeLeft()

virtual Serializable::SizeType Fw::SerialBufferBase::getDeserializeSizeLeft ( ) const
pure virtual

Get remaining deserialization buffer size.

This method returns the amount of data that remains to be deserialized from the buffer. It indicates how much data is left starting from the current deserialization pointer to the end of the valid size (returned by getSize()).

Returns
The remaining size of the deserialization buffer in bytes

Implemented in Fw::LinearBufferBase.

◆ getSerializeSizeLeft()

virtual Serializable::SizeType Fw::SerialBufferBase::getSerializeSizeLeft ( ) const
pure virtual

Get remaining serialization buffer size.

This method returns the amount of space available for serialization in the buffer. It indicates how much data can still be written to the buffer starting from the current serialization pointer to the end of the buffer's capacity.

Returns
The remaining size of the serialization buffer in bytes

Implemented in Fw::LinearBufferBase.

◆ getSize()

virtual Serializable::SizeType Fw::SerialBufferBase::getSize ( ) const
pure virtual

Get current buffer size.

This method returns the current size of the buffer, which indicates how much data is currently stored in the buffer. This may be less than or equal to the buffer's capacity.

Returns
The current size of the buffer in bytes

Implemented in Fw::LinearBufferBase.

◆ moveDeserToOffset()

virtual SerializeStatus Fw::SerialBufferBase::moveDeserToOffset ( FwSizeType  offset)
pure virtual

Move deserialization pointer to specified offset.

This method moves the deserialization pointer to the specified offset within the buffer. This allows for skipping over data or positioning the deserializer at a specific location in the buffer.

Parameters
offsetThe offset to move the deserialization pointer to
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ moveSerToOffset()

virtual SerializeStatus Fw::SerialBufferBase::moveSerToOffset ( FwSizeType  offset)
pure virtual

Move serialization pointer to specified offset.

This method moves the serialization pointer to the specified offset within the buffer. This allows for skipping over data or positioning the serializer at a specific location in the buffer.

Parameters
offsetThe offset to move the serialization pointer to
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ resetDeser()

virtual void Fw::SerialBufferBase::resetDeser ( )
pure virtual

Reset deserialization pointer to beginning of buffer.

This method resets the deserialization pointer to the beginning of the buffer, allowing the buffer to be reused for new deserialization operations. The buffer contents are not modified, but the pointer is reset to allow reading from the start of the data.

Implemented in Fw::LinearBufferBase.

◆ resetSer()

virtual void Fw::SerialBufferBase::resetSer ( )
pure virtual

Reset serialization pointer to beginning of buffer.

This method resets the serialization pointer to the beginning of the buffer, allowing the buffer to be reused for new serialization operations. Any data that was previously serialized in the buffer will be overwritten.

Implemented in Fw::LinearBufferBase.

◆ serializeFrom() [1/10]

virtual SerializeStatus Fw::SerialBufferBase::serializeFrom ( U8  val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Serialize an 8-bit unsigned integer value.

This method serializes a single 8-bit unsigned integer value into the buffer. The endianness of the serialization can be controlled via the mode parameter.

NOTE: The 'mode' argument here for endianness has no effect as there is no concept of endianness for a U8. It has been left in for compatibility.

Parameters
valThe 8-bit unsigned integer value to serialize
modeEndianness mode for serialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ serializeFrom() [2/10]

virtual SerializeStatus Fw::SerialBufferBase::serializeFrom ( I8  val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Serialize an 8-bit signed integer value.

This method serializes a single 8-bit signed integer value into the buffer. The endianness of the serialization can be controlled via the mode parameter.

NOTE: The 'mode' argument here for endianness has no effect as there is no concept of endianness for an I8. It has been left in for compatibility.

Parameters
valThe 8-bit signed integer value to serialize
modeEndianness mode for serialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ serializeFrom() [3/10]

virtual SerializeStatus Fw::SerialBufferBase::serializeFrom ( F32  val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Serialize a 32-bit floating point value.

This method serializes a single 32-bit floating point value into the buffer. The endianness of the serialization can be controlled via the mode parameter.

Parameters
valThe 32-bit floating point value to serialize
modeEndianness mode for serialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ serializeFrom() [4/10]

virtual SerializeStatus Fw::SerialBufferBase::serializeFrom ( F64  val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Serialize a 64-bit floating point value.

This method serializes a single 64-bit floating point value into the buffer. The endianness of the serialization can be controlled via the mode parameter.

Parameters
valThe 64-bit floating point value to serialize
modeEndianness mode for serialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ serializeFrom() [5/10]

virtual SerializeStatus Fw::SerialBufferBase::serializeFrom ( bool  val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Serialize a boolean value.

This method serializes a single boolean value into the buffer. The endianness of the serialization can be controlled via the mode parameter.

Parameters
valThe boolean value to serialize
modeEndianness mode for serialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ serializeFrom() [6/10]

virtual SerializeStatus Fw::SerialBufferBase::serializeFrom ( const void *  val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Serialize a pointer value.

This method serializes a pointer value into the buffer. Note that only the pointer value itself is serialized, not the contents it points to. The endianness of the serialization can be controlled via the mode parameter.

Parameters
valThe pointer value to serialize
modeEndianness mode for serialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ serializeFrom() [7/10]

virtual SerializeStatus Fw::SerialBufferBase::serializeFrom ( const U8 buff,
FwSizeType  length,
Endianness  endianMode = Endianness::BIG 
)
pure virtual

Serialize a data buffer.

This method serializes a buffer of bytes into the serialization buffer. The endianness of the serialization can be controlled via the mode parameter.

Parameters
buffPointer to the buffer containing data to serialize
lengthNumber of bytes to serialize from the buffer
endianModeEndianness mode for serialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ serializeFrom() [8/10]

virtual SerializeStatus Fw::SerialBufferBase::serializeFrom ( const U8 buff,
FwSizeType  length,
Serialization::t  lengthMode,
Endianness  endianMode = Endianness::BIG 
)
pure virtual

Serialize a byte buffer with optional length prefix.

This method serializes a buffer of bytes into the serialization buffer. If lengthMode is set to INCLUDE_LENGTH, the length is included as the first token. The endianness of the serialization can be controlled via the endianMode parameter.

Parameters
buffPointer to the buffer containing data to serialize
lengthNumber of bytes to serialize from the buffer
lengthModeSpecifies whether to include length in serialization (INCLUDE_LENGTH or OMIT_LENGTH)
endianModeEndianness mode for serialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ serializeFrom() [9/10]

virtual SerializeStatus Fw::SerialBufferBase::serializeFrom ( const LinearBufferBase val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Serialize another LinearBufferBase object.

This method serializes the contents of another LinearBufferBase object into this buffer. The endianness of the serialization can be controlled via the mode parameter.

Parameters
valReference to the LinearBufferBase object to serialize
modeEndianness mode for serialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ serializeFrom() [10/10]

virtual SerializeStatus Fw::SerialBufferBase::serializeFrom ( const Serializable val,
Endianness  mode = Endianness::BIG 
)
pure virtual

Serialize a Serializable object.

This method serializes an object derived from the Serializable base class into this buffer. The endianness of the serialization can be controlled via the mode parameter.

Parameters
valReference to the Serializable object to serialize
modeEndianness mode for serialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ serializeSize()

virtual SerializeStatus Fw::SerialBufferBase::serializeSize ( const FwSizeType  size,
Endianness  mode = Endianness::BIG 
)
pure virtual

Serialize a size value.

This method serializes a size value (typically used for buffer sizes) into this buffer. The endianness of the serialization can be controlled via the mode parameter.

Parameters
sizeThe size value to serialize
modeEndianness mode for serialization (default is Endianness::BIG)
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ serializeSkip()

virtual SerializeStatus Fw::SerialBufferBase::serializeSkip ( FwSizeType  numBytesToSkip)
pure virtual

Skip specified number of bytes during serialization.

This method advances the serialization pointer by the specified number of bytes without writing any data. This can be used to reserve space in the buffer or skip over data that will be written later.

Parameters
numBytesToSkipNumber of bytes to skip during serialization
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ setBuff()

virtual SerializeStatus Fw::SerialBufferBase::setBuff ( const U8 src,
Serializable::SizeType  length 
)
pure virtual

Set buffer contents from external source.

This method sets the contents of the buffer from an external source. It copies the specified number of bytes from the source pointer into the buffer and updates the buffer size accordingly.

Parameters
srcPointer to the external data source
lengthNumber of bytes to copy from the source
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.

◆ setBuffLen()

virtual SerializeStatus Fw::SerialBufferBase::setBuffLen ( Serializable::SizeType  length)
pure virtual

Set buffer length manually.

This method manually sets the length of the buffer without modifying its contents. This can be used after filling the buffer with data through other means to indicate how much valid data is in the buffer.

Parameters
lengthThe new length to set for the buffer
Returns
SerializeStatus indicating the result of the operation

Implemented in Fw::LinearBufferBase.


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