38 namespace data_processing {
41 : m_is_complete(false)
42 , m_deployed_packet_buffer()
80 if (remainingSize == newPacket.
getLength())
105 headerless_packet_buffer.insert(headerless_packet_buffer.end(),
110 m_buffer_vector.clear();
129 const auto& packet = *it_packet;
130 sum += packet.getLength();
132 return static_cast<uint32_t
>(sum);
sick::datastructure::PacketBuffer getDeployedPacketBuffer()
Gets the latest complete data packet.
A packetbuffer for the raw data from the sensor.
bool addTCPPacket(const sick::datastructure::PacketBuffer &buffer)
Adds a new tcp packet to the merger. Returns true if this tcp packet completes a data packet...
bool isEmpty() const
Checks if the buffer vector is empty.
uint32_t getTargetSize() const
Returns the expected target size of a complete data packet.
void setBuffer(const VectorBuffer &buffer)
Setter for the PacketBuffer.
bool isComplete() const
Check if the packet is complete.
bool deployPacketIfComplete()
const VectorBuffer & getBuffer() const
Getter to return the VectorBuffer saved in the PacketBuffer.
sick::datastructure::PacketBuffer m_deployed_packet_buffer
TCPPacketMerger()
Constructor of merger.
uint32_t getCurrentSize() const
size_t getLength() const
Returns length of the current PacketBuffer.
bool addToMap(const sick::datastructure::PacketBuffer &newPacket)
std::vector< uint8_t > VectorBuffer
Typedef for a vector buffer, to sort the incoming packets.
void setTargetSize(const uint32_t &targetSize)
Sets the target size of a data packet.
std::vector< sick::datastructure::PacketBuffer > m_buffer_vector