16#if FW_SERIALIZABLE_TO_STRING
25 m_bufferData(nullptr),
31 m_serialize_repr(src.m_bufferData, src.m_size),
32 m_bufferData(src.m_bufferData),
34 m_context(src.m_context)
43 if(m_bufferData !=
nullptr){
44 this->m_serialize_repr.
setExtBuffer(this->m_bufferData, this->m_size);
51 this->
set(src.m_bufferData, src.m_size, src.m_context);
57 return (this->m_bufferData == src.m_bufferData) && (this->m_size == src.m_size) && (this->m_context == src.m_context);
61 return this->m_bufferData;
69 return this->m_context;
73 this->m_bufferData = data;
74 if (m_bufferData !=
nullptr) {
75 this->m_serialize_repr.
setExtBuffer(this->m_bufferData, this->m_size);
81 if (m_bufferData !=
nullptr) {
82 this->m_serialize_repr.
setExtBuffer(this->m_bufferData, this->m_size);
87 this->m_context = context;
91 this->m_bufferData = data;
93 if (m_bufferData !=
nullptr) {
94 this->m_serialize_repr.
setExtBuffer(this->m_bufferData, this->m_size);
96 this->m_context = context;
100 return m_serialize_repr;
105#if FW_SERIALIZATION_TYPE_ID
106 stat = buffer.
serialize(
static_cast<U32
>(Buffer::TYPE_ID));
119 stat = buffer.
serialize(this->m_context);
129#if FW_SERIALIZATION_TYPE_ID
137 if (typeId != Buffer::TYPE_ID) {
146 this->m_bufferData =
reinterpret_cast<U8*
>(pointer);
157 if (this->m_bufferData !=
nullptr) {
158 this->m_serialize_repr.
setExtBuffer(this->m_bufferData, this->m_size);
163#if FW_SERIALIZABLE_TO_STRING || BUILD_UT
165 static const char * formatString =
"(data = %p, size = %u,context = %u)";
166 char outputString[FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE];
168 (void)snprintf(outputString, FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE, formatString, this->m_bufferData, this->m_size,
171 outputString[FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE-1] = 0;
177 std::ostream& operator<<(std::ostream& os,
const Buffer& obj) {
PlatformPointerCastType POINTER_CAST
uint8_t U8
8-bit unsigned integer
C++-compatible configuration header for fprime configuration.
bool operator==(const Buffer &src) const
void set(U8 *data, U32 size, U32 context=NO_CONTEXT)
Fw::SerializeStatus deserialize(Fw::SerializeBufferBase &buffer)
void setContext(U32 context)
Fw::SerializeStatus serialize(Fw::SerializeBufferBase &serialBuffer) const
Buffer & operator=(const Buffer &src)
SerializeBufferBase & getSerializeRepr()
void setExtBuffer(U8 *buffPtr, NATIVE_UINT_TYPE size)
Set the external buffer.
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
const char * toChar() const
gets char buffer
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
@ FW_DESERIALIZE_TYPE_MISMATCH
Deserialized type ID didn't match.