![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
#include <Fw/Types/Serializable.hpp>
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... | |
Definition at line 112 of file Serializable.hpp.
|
virtual |
Virtual destructor.
Ensures proper cleanup of derived classes.
Definition at line 40 of file Serializable.cpp.
|
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).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.| dest | Destination serialization buffer to receive the bytes (its contents are replaced) |
| size | Number of bytes to copy from the source |
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.
|
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).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.| dest | Destination serialization buffer to append to |
| size | Number of bytes to copy from the source and append to dest |
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.
|
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.
| size | Reference to store the deserialized size value |
| mode | Endianness mode for deserialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| numBytesToSkip | Number of bytes to skip during deserialization |
Implemented in Fw::LinearBufferBase.
|
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.
| val | Reference to store the deserialized 8-bit unsigned integer value |
| mode | Endianness mode for deserialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | Reference to store the deserialized 8-bit signed integer value |
| mode | Endianness mode for deserialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | Reference to store the deserialized 32-bit floating point value |
| mode | Endianness mode for deserialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | Reference to store the deserialized 64-bit floating point value |
| mode | Endianness mode for deserialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | Reference to store the deserialized boolean value |
| mode | Endianness mode for deserialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | Reference to store the deserialized pointer value |
| mode | Endianness mode for deserialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| buff | Pointer to the buffer where deserialized data will be stored |
| length | Reference to store the actual number of bytes deserialized |
| endianMode | Endianness mode for deserialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| buff | Pointer to the buffer where deserialized data will be stored |
| length | Reference to store the actual number of bytes deserialized |
| lengthMode | Specifies whether length was included in serialization (INCLUDE_LENGTH or OMIT_LENGTH) |
| endianMode | Endianness mode for deserialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | Reference to the Serializable object that will be populated with deserialized data |
| mode | Endianness mode for deserialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | Reference to the LinearBufferBase object that will be populated with deserialized data |
| mode | Endianness mode for deserialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
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.
|
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()).
Implemented in Fw::LinearBufferBase.
|
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.
Implemented in Fw::LinearBufferBase.
|
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.
Implemented in Fw::LinearBufferBase.
|
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.
| offset | The offset to move the deserialization pointer to |
Implemented in Fw::LinearBufferBase.
|
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.
| offset | The offset to move the serialization pointer to |
Implemented in Fw::LinearBufferBase.
|
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.
|
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.
|
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.
| val | The 8-bit unsigned integer value to serialize |
| mode | Endianness mode for serialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | The 8-bit signed integer value to serialize |
| mode | Endianness mode for serialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | The 32-bit floating point value to serialize |
| mode | Endianness mode for serialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | The 64-bit floating point value to serialize |
| mode | Endianness mode for serialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | The boolean value to serialize |
| mode | Endianness mode for serialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | The pointer value to serialize |
| mode | Endianness mode for serialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| buff | Pointer to the buffer containing data to serialize |
| length | Number of bytes to serialize from the buffer |
| endianMode | Endianness mode for serialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| buff | Pointer to the buffer containing data to serialize |
| length | Number of bytes to serialize from the buffer |
| lengthMode | Specifies whether to include length in serialization (INCLUDE_LENGTH or OMIT_LENGTH) |
| endianMode | Endianness mode for serialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | Reference to the LinearBufferBase object to serialize |
| mode | Endianness mode for serialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| val | Reference to the Serializable object to serialize |
| mode | Endianness mode for serialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| size | The size value to serialize |
| mode | Endianness mode for serialization (default is Endianness::BIG) |
Implemented in Fw::LinearBufferBase.
|
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.
| numBytesToSkip | Number of bytes to skip during serialization |
Implemented in Fw::LinearBufferBase.
|
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.
| src | Pointer to the external data source |
| length | Number of bytes to copy from the source |
Implemented in Fw::LinearBufferBase.
|
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.
| length | The new length to set for the buffer |
Implemented in Fw::LinearBufferBase.