38 namespace data_processing {
41 : m_is_complete(false)
82 if (remaining_size == new_packet.
getLength())
102 std::vector<uint8_t> headerless_packet_buffer;
106 const std::shared_ptr<std::vector<uint8_t>
const> vec_ptr = parsed_packet_buffer.getBuffer();
107 headerless_packet_buffer.insert(
108 headerless_packet_buffer.end(), vec_ptr->begin(), vec_ptr->end());
111 m_buffer_vector.clear();
130 const auto& packet = *it_packet;
131 sum += packet.getLength();
134 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.
uint32_t getCurrentSize()
bool isComplete() const
Check if the packet is complete.
bool addToMap(const sick::datastructure::PacketBuffer &new_packet)
bool deployPacketIfComplete()
sick::datastructure::PacketBuffer m_deployed_packet_buffer
TCPPacketMerger()
Constructor of merger.
size_t getLength() const
Returns length of the current PacketBuffer.
std::mutex m_buffer_mutex
void setBuffer(const std::vector< uint8_t > &buffer)
Setter for the PacketBuffer.
void setTargetSize(const uint32_t &targetSize)
Sets the target size of a data packet.
std::vector< sick::datastructure::PacketBuffer > m_buffer_vector