38 namespace data_processing {
41 : m_is_complete(false)
82 it->second.push_back(parsed_packet_buffer);
87 vec.push_back(parsed_packet_buffer);
120 if (cur_length != total_length)
131 uint32_t cur_length = 0;
133 for (
auto& parsed_packet_buffer : vec)
155 std::vector<uint8_t> headerless_packet_buffer;
156 for (
auto& parsed_packet_buffer : vec)
161 const std::shared_ptr<std::vector<uint8_t>
const> vec_ptr = packet_buffer.
getBuffer();
162 headerless_packet_buffer.insert(headerless_packet_buffer.end(),
167 return headerless_packet_buffer;
std::mutex m_buffer_mutex
bool deployPacketIfComplete(datastructure::DatagramHeader &header)
sick::datastructure::PacketBuffer getDeployedPacketBuffer()
Get the latest complete data packet.
Struct of a PacketBuffer with a parsed header.
A packetbuffer for the raw data from the sensor.
std::shared_ptr< std::vector< uint8_t > const > getBuffer() const
Getter to return a copy of the data saved in the PacketBuffer.
bool addToMap(const sick::datastructure::PacketBuffer &buffer, const sick::datastructure::DatagramHeader &header)
bool checkIfComplete(sick::datastructure::DatagramHeader &header)
bool addUDPPacket(const sick::datastructure::PacketBuffer &buffer)
Adds a udp packet to the packet map, when a data packet is complete it will return true...
bool isComplete() const
Returns if a data packet is complete.
std::map< uint32_t, sick::datastructure::ParsedPacketBuffer::ParsedPacketBufferVector > m_parsed_packet_buffer_map
uint32_t calcualteCurrentLengthOfParsedPacketBuffer(const sick::datastructure::ParsedPacketBuffer::ParsedPacketBufferVector &vec)
UDPPacketMerger()
Constructor of udp packet merger.
static bool sortForIncreasingOffset(const ParsedPacketBuffer &ppb1, const ParsedPacketBuffer &ppb2)
Static function to sort ParsedPacketBuffers.
size_t getLength() const
Returns length of the current PacketBuffer.
sick::datastructure::ParsedPacketBuffer::ParsedPacketBufferVector getSortedParsedPacketBufferForIdentification(const sick::datastructure::DatagramHeader &header)
std::vector< ParsedPacketBuffer > ParsedPacketBufferVector
void setBuffer(const std::vector< uint8_t > &buffer)
Setter for the PacketBuffer.
sick::datastructure::PacketBuffer m_deployed_packet_buffer
std::vector< uint8_t > removeHeaderFromParsedPacketBuffer(const sick::datastructure::ParsedPacketBuffer::ParsedPacketBufferVector &vec)