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

#include <Fw/Types/Serializable.hpp>

Inheritance diagram for Fw::LinearBufferBase:
Fw::SerialBufferBase 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 ~LinearBufferBase ()
 Destructor. More...
 
SerializeStatus serializeFrom (U8 val, Endianness mode=Endianness::BIG) override
 Serialize an 8-bit unsigned integer value. More...
 
SerializeStatus serializeFrom (I8 val, Endianness mode=Endianness::BIG) override
 Serialize an 8-bit signed integer value. More...
 
SerializeStatus serializeFrom (F32 val, Endianness mode=Endianness::BIG) override
 Serialize a 32-bit floating point value. More...
 
SerializeStatus serializeFrom (F64 val, Endianness mode=Endianness::BIG) override
 Serialize a 64-bit floating point value. More...
 
SerializeStatus serializeFrom (bool val, Endianness mode=Endianness::BIG) override
 Serialize a boolean value. More...
 
SerializeStatus serializeFrom (const void *val, Endianness mode=Endianness::BIG) override
 Serialize a pointer value. More...
 
SerializeStatus serializeFrom (const U8 *buff, FwSizeType length, Endianness endianMode=Endianness::BIG) override
 Serialize a data buffer. More...
 
SerializeStatus serializeFrom (const U8 *buff, FwSizeType length, Serialization::t lengthMode, Endianness endianMode=Endianness::BIG) override
 Serialize a byte buffer with optional length prefix. More...
 
SerializeStatus serializeFrom (const LinearBufferBase &val, Endianness mode=Endianness::BIG) override
 Serialize another LinearBufferBase object. More...
 
SerializeStatus serializeFrom (const Serializable &val, Endianness mode=Endianness::BIG) override
 Serialize a Serializable object. More...
 
SerializeStatus serializeSize (const FwSizeType size, Endianness mode=Endianness::BIG) override
 Serialize a size value. More...
 
SerializeStatus deserializeTo (U8 &val, Endianness mode=Endianness::BIG) override
 Deserialize an 8-bit unsigned integer value. More...
 
SerializeStatus deserializeTo (I8 &val, Endianness mode=Endianness::BIG) override
 Deserialize an 8-bit signed integer value. More...
 
SerializeStatus deserializeTo (F32 &val, Endianness mode=Endianness::BIG) override
 Deserialize a 32-bit floating point value. More...
 
SerializeStatus deserializeTo (F64 &val, Endianness mode=Endianness::BIG) override
 Deserialize a 64-bit floating point value. More...
 
SerializeStatus deserializeTo (bool &val, Endianness mode=Endianness::BIG) override
 Deserialize a boolean value. More...
 
SerializeStatus deserializeTo (void *&val, Endianness mode=Endianness::BIG) override
 Deserialize a pointer value. More...
 
SerializeStatus deserializeTo (U8 *buff, FwSizeType &length, Endianness endianMode=Endianness::BIG) override
 Deserialize a data buffer. More...
 
SerializeStatus deserializeTo (U8 *buff, FwSizeType &length, Serialization::t lengthMode, Endianness endianMode=Endianness::BIG) override
 Deserialize a byte buffer with optional length prefix. More...
 
SerializeStatus deserializeTo (Serializable &val, Endianness mode=Endianness::BIG) override
 Deserialize a Serializable object. More...
 
SerializeStatus deserializeTo (LinearBufferBase &val, Endianness mode=Endianness::BIG) override
 Deserialize a LinearBufferBase object. More...
 
SerializeStatus deserializeSize (FwSizeType &size, Endianness mode=Endianness::BIG) override
 Deserialize a size value. More...
 
 DEPRECATED (SerializeStatus serialize(const LinearBufferBase &val), "Use serializeFrom(const SerialBufferBase& val) instead")
 
 DEPRECATED (SerializeStatus deserialize(LinearBufferBase &val), "Use deserializeTo(SerialBufferBase& val) instead")
 
void resetSer () override
 Reset serialization pointer to beginning of buffer. More...
 
void resetDeser () override
 Reset deserialization pointer to beginning of buffer. More...
 
SerializeStatus moveSerToOffset (FwSizeType offset) override
 Move serialization pointer to specified offset. More...
 
SerializeStatus moveDeserToOffset (FwSizeType offset) override
 Move deserialization pointer to specified offset. More...
 
SerializeStatus serializeSkip (FwSizeType numBytesToSkip) override
 Skip specified number of bytes during serialization. More...
 
SerializeStatus deserializeSkip (FwSizeType numBytesToSkip) override
 Skip specified number of bytes during deserialization. More...
 
 DEPRECATED (Serializable::SizeType getBuffCapacity() const, "Use getCapacity() instead")
 
 DEPRECATED (Serializable::SizeType getBuffLength() const, "Use getSize() instead")
 
 DEPRECATED (Serializable::SizeType getBuffLeft(), "Use getDeserializeSizeLeft() instead")
 
Serializable::SizeType getCapacity () const override=0
 Get buffer capacity. More...
 
Serializable::SizeType getSize () const override
 Get current buffer size. More...
 
Serializable::SizeType getDeserializeSizeLeft () const override
 Get remaining deserialization buffer size. More...
 
Serializable::SizeType getSerializeSizeLeft () const override
 Get remaining serialization buffer size. More...
 
virtual U8getBuffAddr ()=0
 Get buffer address for data filling (non-const version) More...
 
virtual const U8getBuffAddr () const =0
 Get buffer address for data reading (const version) More...
 
const U8getBuffAddrLeft () const
 Get address of remaining non-deserialized data. More...
 
U8getBuffAddrSer ()
 Get address of end of serialization (DANGEROUS!) More...
 
SerializeStatus setBuff (const U8 *src, Serializable::SizeType length) override
 Set buffer contents from external source. More...
 
SerializeStatus setBuffLen (Serializable::SizeType length) override
 Set buffer length manually. More...
 
SerializeStatus copyRaw (SerialBufferBase &dest, Serializable::SizeType size) override
 Copy raw bytes from this buffer to destination and advance source offset. More...
 
SerializeStatus copyRawOffset (SerialBufferBase &dest, Serializable::SizeType size) override
 Append raw bytes to destination from this buffer and advance source offset. More...
 
 DEPRECATED (SerializeStatus serialize(U8 val), "Use serializeFrom(U8 val) instead")
 
 DEPRECATED (SerializeStatus serialize(I8 val), "Use serializeFrom(I8 val) instead")
 
 DEPRECATED (SerializeStatus serialize(F32 val), "Use serializeFrom(F32 val) instead")
 
 DEPRECATED (SerializeStatus serialize(F64 val), "Use serializeFrom(F64 val) instead")
 
 DEPRECATED (SerializeStatus serialize(bool val), "Use serializeFrom(bool val) instead")
 
 DEPRECATED (SerializeStatus serialize(const void *val), "Use serializeFrom(const void* val) instead")
 
 DEPRECATED (SerializeStatus serialize(const U8 *buff, FwSizeType length, bool noLength), "Use serialize(const U8* buff, FwSizeType length, Serialization::t mode) instead")
 
 DEPRECATED (SerializeStatus serialize(const U8 *buff, FwSizeType length), "Use serializeFrom(const U8* buff, FwSizeType length) instead")
 
 DEPRECATED (SerializeStatus serialize(const U8 *buff, FwSizeType length, Serialization::t mode), "Use serializeFrom(const U8* buff, FwSizeType length, Serialization::t mode) instead")
 
 DEPRECATED (SerializeStatus serialize(const Serializable &val), "Use serializeFrom(const Serializable& val) instead")
 
 DEPRECATED (SerializeStatus deserialize(U8 &val), "Use deserializeTo(U8& val) instead")
 
 DEPRECATED (SerializeStatus deserialize(I8 &val), "Use deserializeTo(I8& val) instead")
 
 DEPRECATED (SerializeStatus deserialize(F32 &val), "Use deserializeTo(F32& val) instead")
 
 DEPRECATED (SerializeStatus deserialize(F64 &val), "Use deserializeTo(F64& val) instead")
 
 DEPRECATED (SerializeStatus deserialize(bool &val), "Use deserializeTo(bool& val) instead")
 
 DEPRECATED (SerializeStatus deserialize(void *&val), "Use deserializeTo(void*& val) instead")
 
 DEPRECATED (SerializeStatus deserialize(U8 *buff, FwSizeType &length, bool noLength), "Use deserialize(U8* buff, FwSizeType& length, Serialization::t mode) instead")
 
 DEPRECATED (SerializeStatus deserialize(U8 *buff, FwSizeType &length), "Use deserializeTo(U8* buff, FwSizeType& length) instead")
 
 DEPRECATED (SerializeStatus deserialize(U8 *buff, FwSizeType &length, Serialization::t mode), "Use deserializeTo(U8* buff, FwSizeType& length, Serialization::t mode) instead")
 
 DEPRECATED (SerializeStatus deserialize(Serializable &val), "Use deserializeTo(Serializable& val) instead")
 
- Public Member Functions inherited from Fw::SerialBufferBase
virtual ~SerialBufferBase ()
 Virtual destructor. More...
 

Protected Member Functions

LinearBufferBaseoperator= (const LinearBufferBase &src)
 Copy assignment operator. More...
 
 LinearBufferBase ()
 Default constructor. More...
 
 LinearBufferBase (const LinearBufferBase &src)
 Copy constructor (protected) More...
 
void copyFrom (const LinearBufferBase &src)
 Copy data from source buffer. More...
 

Protected Attributes

Serializable::SizeType m_serLoc
 current offset in buffer of serialized data More...
 
Serializable::SizeType m_deserLoc
 current offset for deserialization More...
 

Friends

class SerializeBufferBaseTester
 

Detailed Description

Definition at line 672 of file Serializable.hpp.

Constructor & Destructor Documentation

◆ ~LinearBufferBase()

Fw::LinearBufferBase::~LinearBufferBase ( )
virtual

Destructor.

Destroys a LinearBufferBase instance. This is a virtual destructor that allows proper cleanup of derived classes.

Definition at line 44 of file Serializable.cpp.

◆ LinearBufferBase() [1/2]

Fw::LinearBufferBase::LinearBufferBase ( )
protected

Default constructor.

Initializes a LinearBufferBase instance with default values. Sets the serialization and deserialization locations to zero.

Definition at line 42 of file Serializable.cpp.

◆ LinearBufferBase() [2/2]

Fw::LinearBufferBase::LinearBufferBase ( const LinearBufferBase src)
protected

Copy constructor (protected)

Creates a copy of another LinearBufferBase instance. This constructor is protected and intended for use only by derived classes or internal implementation details.

Parameters
srcReference to the source LinearBufferBase to copy from

Member Function Documentation

◆ copyFrom()

void Fw::LinearBufferBase::copyFrom ( const LinearBufferBase src)
protected

Copy data from source buffer.

Copies the contents from another LinearBufferBase instance to this one. This includes copying the buffer data, serialization location, and deserialization location.

Parameters
srcReference to the source LinearBufferBase to copy data from

Definition at line 46 of file Serializable.cpp.

◆ copyRaw()

SerializeStatus Fw::LinearBufferBase::copyRaw ( SerialBufferBase dest,
Serializable::SizeType  size 
)
overridevirtual

Copy raw bytes from this buffer to destination and advance source offset.

This method copies exactly size bytes from the current position in this buffer to the destination buffer. It advances the source buffer's position by the number of bytes copied.

Parameters
destDestination buffer to receive the copied data
sizeNumber of bytes to copy
Returns
SerializeStatus indicating the result of the operation

Implements Fw::SerialBufferBase.

Definition at line 689 of file Serializable.cpp.

◆ copyRawOffset()

SerializeStatus Fw::LinearBufferBase::copyRawOffset ( SerialBufferBase dest,
Serializable::SizeType  size 
)
overridevirtual

Append raw bytes to destination from this buffer and advance source offset.

This method appends exactly size bytes from the current position in this buffer to the destination buffer. It uses Serialization::OMIT_LENGTH mode, meaning no length token is written. The source buffer's position is advanced by the number of bytes copied.

Parameters
destDestination buffer to append data to
sizeNumber of bytes to append
Returns
SerializeStatus indicating the result of the operation

Implements Fw::SerialBufferBase.

Definition at line 707 of file Serializable.cpp.

◆ DEPRECATED() [1/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   serializeconst LinearBufferBase &val,
"Use serializeFrom(const SerialBufferBase& val) instead"   
)

◆ DEPRECATED() [2/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   deserializeLinearBufferBase &val,
"Use deserializeTo(SerialBufferBase& val) instead"   
)

◆ DEPRECATED() [3/25]

Fw::LinearBufferBase::DEPRECATED ( Serializable::SizeType getBuffCapacity()  const,
"Use getCapacity() instead"   
)

◆ DEPRECATED() [4/25]

Fw::LinearBufferBase::DEPRECATED ( Serializable::SizeType getBuffLength()  const,
"Use getSize() instead"   
)

◆ DEPRECATED() [5/25]

Fw::LinearBufferBase::DEPRECATED ( Serializable::SizeType   getBuffLeft(),
"Use getDeserializeSizeLeft() instead"   
)

◆ DEPRECATED() [6/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   serializeU8 val,
"Use serializeFrom(U8 val) instead"   
)

◆ DEPRECATED() [7/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   serializeI8 val,
"Use serializeFrom(I8 val) instead"   
)

◆ DEPRECATED() [8/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   serializeF32 val,
"Use serializeFrom(F32 val) instead"   
)

◆ DEPRECATED() [9/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   serializeF64 val,
"Use serializeFrom(F64 val) instead"   
)

◆ DEPRECATED() [10/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   serializebool val,
"Use serializeFrom(bool val) instead"   
)

◆ DEPRECATED() [11/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   serializeconst void *val,
"Use serializeFrom(const void* val) instead"   
)

◆ DEPRECATED() [12/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   serializeconst U8 *buff, FwSizeType length, bool noLength,
"Use serialize(const U8* buff, FwSizeType length, Serialization::t mode) instead"   
)

◆ DEPRECATED() [13/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   serializeconst U8 *buff, FwSizeType length,
"Use serializeFrom(const U8* buff, FwSizeType length) instead"   
)

◆ DEPRECATED() [14/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   serializeconst U8 *buff, FwSizeType length, Serialization::t mode,
"Use serializeFrom(const U8* buff, FwSizeType length, Serialization::t mode) instead"   
)

◆ DEPRECATED() [15/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   serializeconst Serializable &val,
"Use serializeFrom(const Serializable& val) instead"   
)

◆ DEPRECATED() [16/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   deserializeU8 &val,
"Use deserializeTo(U8& val) instead"   
)

◆ DEPRECATED() [17/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   deserializeI8 &val,
"Use deserializeTo(I8& val) instead"   
)

◆ DEPRECATED() [18/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   deserializeF32 &val,
"Use deserializeTo(F32& val) instead"   
)

◆ DEPRECATED() [19/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   deserializeF64 &val,
"Use deserializeTo(F64& val) instead"   
)

◆ DEPRECATED() [20/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   deserializebool &val,
"Use deserializeTo(bool& val) instead"   
)

◆ DEPRECATED() [21/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   deserializevoid *&val,
"Use deserializeTo(void*& val) instead"   
)

◆ DEPRECATED() [22/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   deserializeU8 *buff, FwSizeType &length, bool noLength,
"Use deserialize(U8* buff, FwSizeType& length, Serialization::t mode) instead"   
)

◆ DEPRECATED() [23/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   deserializeU8 *buff, FwSizeType &length,
"Use deserializeTo(U8* buff, FwSizeType& length) instead"   
)

◆ DEPRECATED() [24/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   deserializeU8 *buff, FwSizeType &length, Serialization::t mode,
"Use deserializeTo(U8* buff, FwSizeType& length, Serialization::t mode) instead"   
)

◆ DEPRECATED() [25/25]

Fw::LinearBufferBase::DEPRECATED ( SerializeStatus   deserializeSerializable &val,
"Use deserializeTo(Serializable& val) instead"   
)

◆ deserializeSize()

SerializeStatus Fw::LinearBufferBase::deserializeSize ( FwSizeType size,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 594 of file Serializable.cpp.

◆ deserializeSkip()

SerializeStatus Fw::LinearBufferBase::deserializeSkip ( FwSizeType  numBytesToSkip)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 626 of file Serializable.cpp.

◆ deserializeTo() [1/10]

SerializeStatus Fw::LinearBufferBase::deserializeTo ( U8 val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 297 of file Serializable.cpp.

◆ deserializeTo() [2/10]

SerializeStatus Fw::LinearBufferBase::deserializeTo ( I8 val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 311 of file Serializable.cpp.

◆ deserializeTo() [3/10]

SerializeStatus Fw::LinearBufferBase::deserializeTo ( F32 val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 502 of file Serializable.cpp.

◆ deserializeTo() [4/10]

SerializeStatus Fw::LinearBufferBase::deserializeTo ( F64 val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 458 of file Serializable.cpp.

◆ deserializeTo() [5/10]

SerializeStatus Fw::LinearBufferBase::deserializeTo ( bool &  val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 471 of file Serializable.cpp.

◆ deserializeTo() [6/10]

SerializeStatus Fw::LinearBufferBase::deserializeTo ( void *&  val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 492 of file Serializable.cpp.

◆ deserializeTo() [7/10]

SerializeStatus Fw::LinearBufferBase::deserializeTo ( U8 buff,
FwSizeType length,
Endianness  endianMode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 514 of file Serializable.cpp.

◆ deserializeTo() [8/10]

SerializeStatus Fw::LinearBufferBase::deserializeTo ( U8 buff,
FwSizeType length,
Serialization::t  lengthMode,
Endianness  endianMode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 521 of file Serializable.cpp.

◆ deserializeTo() [9/10]

SerializeStatus Fw::LinearBufferBase::deserializeTo ( Serializable val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 558 of file Serializable.cpp.

◆ deserializeTo() [10/10]

SerializeStatus Fw::LinearBufferBase::deserializeTo ( LinearBufferBase val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 562 of file Serializable.cpp.

◆ getBuffAddr() [1/2]

virtual U8* Fw::LinearBufferBase::getBuffAddr ( )
pure virtual

Get buffer address for data filling (non-const version)

This method returns a pointer to the buffer's data area where data can be written. This is the non-const version of the method, allowing the buffer contents to be modified.

Returns
Pointer to the buffer's data area

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

◆ getBuffAddr() [2/2]

virtual const U8* Fw::LinearBufferBase::getBuffAddr ( ) const
pure virtual

Get buffer address for data reading (const version)

This method returns a const pointer to the buffer's data area where data can be read. This is the const version of the method, preventing modification of the buffer contents.

Returns
Const pointer to the buffer's data area

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

◆ getBuffAddrLeft()

const U8 * Fw::LinearBufferBase::getBuffAddrLeft ( ) const

Get address of remaining non-deserialized data.

gets address of end of serialization. Used to manually place data at the end

This method returns a const pointer to the portion of the buffer that has not yet been deserialized. This can be used to examine remaining data or to determine how much data is left to process.

Returns
Const pointer to the remaining non-deserialized data

Definition at line 727 of file Serializable.cpp.

◆ getBuffAddrSer()

U8 * Fw::LinearBufferBase::getBuffAddrSer ( )

Get address of end of serialization (DANGEROUS!)

This method returns a pointer to the current end of serialized data in the buffer. This is a dangerous operation as it requires knowledge of the maximum buffer size and proper adjustment when done.

Returns
Pointer to the end of serialized data

Definition at line 732 of file Serializable.cpp.

◆ getCapacity()

Serializable::SizeType Fw::LinearBufferBase::getCapacity ( ) const
overridepure 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

Implements Fw::SerialBufferBase.

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

◆ getDeserializeSizeLeft()

Serializable::SizeType Fw::LinearBufferBase::getDeserializeSizeLeft ( ) const
overridevirtual

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 buffer.

Returns
The remaining size of the deserialization buffer in bytes

Implements Fw::SerialBufferBase.

Definition at line 678 of file Serializable.cpp.

◆ getSerializeSizeLeft()

Serializable::SizeType Fw::LinearBufferBase::getSerializeSizeLeft ( ) const
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 684 of file Serializable.cpp.

◆ getSize()

Serializable::SizeType Fw::LinearBufferBase::getSize ( ) const
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 651 of file Serializable.cpp.

◆ moveDeserToOffset()

SerializeStatus Fw::LinearBufferBase::moveDeserToOffset ( FwSizeType  offset)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 644 of file Serializable.cpp.

◆ moveSerToOffset()

SerializeStatus Fw::LinearBufferBase::moveSerToOffset ( FwSizeType  offset)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 638 of file Serializable.cpp.

◆ operator=()

LinearBufferBase & Fw::LinearBufferBase::operator= ( const LinearBufferBase src)
protected

Copy assignment operator.

Assigns the contents of another LinearBufferBase instance to this one. This includes copying the buffer data, serialization location, and deserialization location from the source to this instance.

Parameters
srcReference to the source LinearBufferBase to copy from
Returns
Reference to this instance after assignment

Definition at line 59 of file Serializable.cpp.

◆ resetDeser()

void Fw::LinearBufferBase::resetDeser ( )
overridevirtual

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.

Returns
None

Implements Fw::SerialBufferBase.

Definition at line 608 of file Serializable.cpp.

◆ resetSer()

void Fw::LinearBufferBase::resetSer ( )
overridevirtual

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.

Returns
None

Implements Fw::SerialBufferBase.

Definition at line 603 of file Serializable.cpp.

◆ serializeFrom() [1/10]

SerializeStatus Fw::LinearBufferBase::serializeFrom ( U8  val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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 an 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

Implements Fw::SerialBufferBase.

Definition at line 66 of file Serializable.cpp.

◆ serializeFrom() [2/10]

SerializeStatus Fw::LinearBufferBase::serializeFrom ( I8  val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 78 of file Serializable.cpp.

◆ serializeFrom() [3/10]

SerializeStatus Fw::LinearBufferBase::serializeFrom ( F32  val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 197 of file Serializable.cpp.

◆ serializeFrom() [4/10]

SerializeStatus Fw::LinearBufferBase::serializeFrom ( F64  val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 190 of file Serializable.cpp.

◆ serializeFrom() [5/10]

SerializeStatus Fw::LinearBufferBase::serializeFrom ( bool  val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 204 of file Serializable.cpp.

◆ serializeFrom() [6/10]

SerializeStatus Fw::LinearBufferBase::serializeFrom ( const void *  val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 221 of file Serializable.cpp.

◆ serializeFrom() [7/10]

SerializeStatus Fw::LinearBufferBase::serializeFrom ( const U8 buff,
FwSizeType  length,
Endianness  endianMode = Endianness::BIG 
)
overridevirtual

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 endianMode 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

Implements Fw::SerialBufferBase.

Definition at line 229 of file Serializable.cpp.

◆ serializeFrom() [8/10]

SerializeStatus Fw::LinearBufferBase::serializeFrom ( const U8 buff,
FwSizeType  length,
Serialization::t  lengthMode,
Endianness  endianMode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 233 of file Serializable.cpp.

◆ serializeFrom() [9/10]

SerializeStatus Fw::LinearBufferBase::serializeFrom ( const LinearBufferBase val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 262 of file Serializable.cpp.

◆ serializeFrom() [10/10]

SerializeStatus Fw::LinearBufferBase::serializeFrom ( const Serializable val,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 258 of file Serializable.cpp.

◆ serializeSize()

SerializeStatus Fw::LinearBufferBase::serializeSize ( const FwSizeType  size,
Endianness  mode = Endianness::BIG 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 284 of file Serializable.cpp.

◆ serializeSkip()

SerializeStatus Fw::LinearBufferBase::serializeSkip ( FwSizeType  numBytesToSkip)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 612 of file Serializable.cpp.

◆ setBuff()

SerializeStatus Fw::LinearBufferBase::setBuff ( const U8 src,
Serializable::SizeType  length 
)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 655 of file Serializable.cpp.

◆ setBuffLen()

SerializeStatus Fw::LinearBufferBase::setBuffLen ( Serializable::SizeType  length)
overridevirtual

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

Implements Fw::SerialBufferBase.

Definition at line 668 of file Serializable.cpp.

Friends And Related Function Documentation

◆ SerializeBufferBaseTester

friend class SerializeBufferBaseTester
friend

Definition at line 673 of file Serializable.hpp.

Member Data Documentation

◆ m_deserLoc

Serializable::SizeType Fw::LinearBufferBase::m_deserLoc
protected

current offset for deserialization

Definition at line 1377 of file Serializable.hpp.

◆ m_serLoc

Serializable::SizeType Fw::LinearBufferBase::m_serLoc
protected

current offset in buffer of serialized data

Definition at line 1376 of file Serializable.hpp.


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