26 const_cast<Buffer&
>(buffer).getData(),
27 const_cast<Buffer&
>(buffer).getSize()
37 return this->m_header;
44 return this->m_startPacket;
51 return this->m_dataPacket;
58 return this->m_endPacket;
65 return this->m_cancelPacket;
71 this->m_startPacket = startPacket;
72 this->m_header.m_type =
T_START;
78 this->m_dataPacket = dataPacket;
79 this->m_header.m_type =
T_DATA;
85 this->m_endPacket = endPacket;
86 this->m_header.m_type =
T_END;
92 this->m_cancelPacket = cancelPacket;
99 switch (this->m_header.m_type) {
119 switch (this->m_header.m_type) {
121 return this->m_startPacket.
toBuffer(buffer);
123 return this->m_dataPacket.
toBuffer(buffer);
125 return this->m_endPacket.
toBuffer(buffer);
127 return this->m_cancelPacket.
toBuffer(buffer);
142 status = this->m_header.fromSerialBuffer(serialBuffer);
147 switch (this->m_header.m_type) {
149 status = this->m_startPacket.fromSerialBuffer(serialBuffer);
152 status = this->m_dataPacket.fromSerialBuffer(serialBuffer);
155 status = this->m_endPacket.fromSerialBuffer(serialBuffer);
158 status = this->m_cancelPacket.fromSerialBuffer(serialBuffer);
The type of a cancel packet.
SerializeStatus toBuffer(Buffer &buffer) const
Convert this CancelPacket to a Buffer.
U32 bufferSize() const
Compute the buffer size needed to hold this CancelPacket.
The type of a data packet.
SerializeStatus toBuffer(Buffer &buffer) const
Convert this DataPacket to a Buffer.
U32 bufferSize() const
Compute the buffer size needed to hold this DataPacket.
The type of an end packet.
U32 bufferSize() const
Compute the buffer size needed to hold this EndPacket.
SerializeStatus toBuffer(Buffer &buffer) const
Convert this EndPacket to a Buffer.
A variable-length serializable buffer.
void fill()
Fill the buffer to capacity with preexisting data.
SerializeStatus
forward declaration for string
@ FW_SERIALIZE_OK
Serialization/Deserialization operation was successful.
@ FW_DESERIALIZE_TYPE_MISMATCH
Deserialized type ID didn't match.
The type of a start packet.
SerializeStatus toBuffer(Buffer &buffer) const
Convert this StartPacket to a Buffer.
U32 bufferSize() const
Compute the buffer size needed to hold this StartPacket.
SerializeStatus fromBuffer(const Buffer &buffer)
void fromCancelPacket(const CancelPacket &cancelPacket)
void fromEndPacket(const EndPacket &endPacket)
const CancelPacket & asCancelPacket() const
const StartPacket & asStartPacket() const
const EndPacket & asEndPacket() const
void fromDataPacket(const DataPacket &dataPacket)
void fromStartPacket(const StartPacket &startPacket)
const DataPacket & asDataPacket() const
const Header & asHeader() const
SerializeStatus toBuffer(Buffer &buffer) const