1 #ifndef SERIALIZABLE_HPP 2 #define SERIALIZABLE_HPP 23 class SerializeBufferBase;
33 #if FW_SERIALIZABLE_TO_STRING || FW_ENABLE_TEXT_LOGGING || BUILD_UT 38 friend std::ostream& operator<<(std::ostream& os,
const Serializable& val);
66 #if FW_HAS_16_BIT == 1 70 #if FW_HAS_32_BIT == 1 74 #if FW_HAS_64_BIT == 1 114 #if FW_HAS_16_BIT == 1 119 #if FW_HAS_32_BIT == 1 123 #if FW_HAS_64_BIT == 1 245 (void)SerializeBufferBase::operator=(src);
Serialization/Deserialization operation was successful.
void clear()
clear external buffer
SerializeBufferBase()
default constructor
Deserialization buffer was empty when trying to read more data.
void resetSer()
reset to beginning of buffer to reuse for serialization
SerializeStatus copyRaw(SerializeBufferBase &dest, Serializable::SizeType size)
directly copies buffer without looking for a size in the stream.
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
ExternalSerializeBuffer & operator=(const SerializeBufferBase &src)=delete
deleted copy assignment operator
int8_t I8
8-bit signed integer
PlatformSizeType FwSizeType
No room left in the buffer to serialize data.
Serializable::SizeType m_buffSize
size of external buffer
virtual ~SerializeBufferBase()
destructor
ExternalSerializeBufferWithDataCopy & operator=(SerializeBufferBase &src)
Deserialization data had incorrect values (unexpected data types)
const U8 * getBuffAddrLeft() const
gets address of remaining non-deserialized data.
ExternalSerializeBuffer()
default constructor
SerializeStatus
forward declaration for string
float F32
32-bit floating point
ExternalSerializeBufferWithDataCopy()
Serializable::SizeType getBuffLength() const
returns current buffer size
Serializable::SizeType getBuffLeft() const
returns how much deserialization buffer is left
Include length as first token in serialization.
Data was the wrong format (e.g. wrong packet type)
virtual SerializeStatus serialize(SerializeBufferBase &buffer) const =0
serialize contents
ExternalSerializeBufferWithMemberCopy(U8 *buffPtr, Serializable::SizeType size)
U8 * m_buff
pointer to external buffer
SerializeStatus serializeSize(const FwSizeType size)
serialize a size value
Data was left in the buffer, but not enough to deserialize.
External serialize buffer with no copy semantics.
ExternalSerializeBufferWithMemberCopy(const ExternalSerializeBufferWithMemberCopy &src)
SerializeStatus deserializeSize(FwSizeType &size)
deserialize a size value
Serializable()
Default constructor.
void resetDeser()
reset deserialization to beginning
SerializeStatus copyRawOffset(SerializeBufferBase &dest, Serializable::SizeType size)
directly copies buffer without looking for a size in the stream.
Deserialized type ID didn't match.
SerializeStatus moveDeserToOffset(FwSizeType offset)
Moves deserialization to the specified offset.
~ExternalSerializeBufferWithDataCopy()
virtual SerializeStatus deserialize(SerializeBufferBase &buffer)=0
deserialize to contents
SerializeStatus moveSerToOffset(FwSizeType offset)
Moves serialization to the specified offset.
C++-compatible configuration header for fprime configuration.
uint8_t U8
8-bit unsigned integer
ExternalSerializeBufferWithMemberCopy & operator=(const ExternalSerializeBufferWithMemberCopy &src)
virtual Serializable::SizeType getBuffCapacity() const =0
returns capacity, not current size, of buffer
SerializeStatus deserializeSkip(FwSizeType numBytesToSkip)
Skips the number of specified bytes for deserialization.
void setExtBuffer(U8 *buffPtr, Serializable::SizeType size)
Omit length from serialization.
virtual ~Serializable()
destructor
~ExternalSerializeBuffer()
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeBufferBase & operator=(const SerializeBufferBase &src)
copy assignment operator
SerializeStatus setBuff(const U8 *src, Serializable::SizeType length)
sets buffer contents and size
Serializable::SizeType getBuffCapacity() const
returns capacity, not current size, of buffer
ExternalSerializeBufferWithMemberCopy()
virtual U8 * getBuffAddr()=0
gets buffer address for data filling
ExternalSerializeBufferWithDataCopy(U8 *buffPtr, Serializable::SizeType size)
~ExternalSerializeBufferWithMemberCopy()
SerializeStatus serializeSkip(FwSizeType numBytesToSkip)
Skips the number of specified bytes for serialization.
U8 * getBuffAddr()
gets buffer address for data filling
SerializeStatus setBuffLen(Serializable::SizeType length)
sets buffer length manually after filling with data