16 #if FW_SERIALIZABLE_TO_STRING
25 m_bufferData(nullptr),
32 m_bufferData(src.m_bufferData),
34 m_context(src.m_context)
36 if(src.m_bufferData !=
nullptr){
37 this->m_serialize_repr.
setExtBuffer(src.m_bufferData, src.m_size);
47 if(m_bufferData !=
nullptr){
48 this->m_serialize_repr.
setExtBuffer(this->m_bufferData, this->m_size);
55 this->
set(src.m_bufferData, src.m_size, src.m_context);
61 return (this->m_bufferData == src.m_bufferData) && (this->m_size == src.m_size) && (this->m_context == src.m_context);
65 return (this->m_bufferData !=
nullptr) && (this->m_size > 0);
69 return this->m_bufferData;
77 return this->m_context;
81 this->m_bufferData = data;
82 if (m_bufferData !=
nullptr) {
83 this->m_serialize_repr.
setExtBuffer(this->m_bufferData, this->m_size);
89 if (m_bufferData !=
nullptr) {
90 this->m_serialize_repr.
setExtBuffer(this->m_bufferData, this->m_size);
95 this->m_context = context;
99 this->m_bufferData = data;
101 if (m_bufferData !=
nullptr) {
102 this->m_serialize_repr.
setExtBuffer(this->m_bufferData, this->m_size);
104 this->m_context = context;
108 return m_serialize_repr;
113 #if FW_SERIALIZATION_TYPE_ID
114 stat = buffer.
serialize(
static_cast<U32
>(Buffer::TYPE_ID));
127 stat = buffer.
serialize(this->m_context);
137 #if FW_SERIALIZATION_TYPE_ID
145 if (typeId != Buffer::TYPE_ID) {
154 this->m_bufferData =
reinterpret_cast<U8*
>(pointer);
165 if (this->m_bufferData !=
nullptr) {
166 this->m_serialize_repr.
setExtBuffer(this->m_bufferData, this->m_size);
171 #if FW_SERIALIZABLE_TO_STRING
173 static const char * formatString =
"(data = %p, size = %u, context = %u)";
174 text.
format(formatString, this->m_bufferData, this->m_size, this->m_context);
179 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, Serializable::SizeType size)
SerializeStatus deserialize(U8 &val)
deserialize 8-bit unsigned int
SerializeStatus serialize(U8 val)
serialize 8-bit unsigned int
void format(const CHAR *formatString,...)
write formatted string to buffer
const char * toChar() const
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
@ FW_DESERIALIZE_TYPE_MISMATCH
Deserialized type ID didn't match.