UDPPacketMerger.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 
24 // -- END LICENSE BLOCK ------------------------------------------------
25 
26 //----------------------------------------------------------------------
33 //----------------------------------------------------------------------
34 
35 #ifndef SICK_SAFETYSCANNERS_DATA_PROCESSING_UDPPACKETMERGER_H
36 #define SICK_SAFETYSCANNERS_DATA_PROCESSING_UDPPACKETMERGER_H
37 
40 
42 
43 #include <algorithm>
44 #include <mutex>
45 
46 namespace sick {
47 namespace data_processing {
48 
53 {
54 public:
59 
65  bool isComplete() const;
66 
75 
82 
83 private:
86 
87  std::map<uint32_t, sick::datastructure::ParsedPacketBuffer::ParsedPacketBufferVector>
89  std::mutex m_buffer_mutex;
90 
99  std::vector<uint8_t> removeHeaderFromParsedPacketBuffer(
101 };
102 
103 } // namespace data_processing
104 } // namespace sick
105 
106 #endif // SICK_SAFETYSCANNERS_DATA_PROCESSING_UDPPACKETMERGER_H
bool deployPacketIfComplete(datastructure::DatagramHeader &header)
sick::datastructure::PacketBuffer getDeployedPacketBuffer()
Get the latest complete data packet.
A packetbuffer for the raw data from the sensor.
Definition: PacketBuffer.h:61
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
Merges udp packets together to a complete data packet.
uint32_t calcualteCurrentLengthOfParsedPacketBuffer(const sick::datastructure::ParsedPacketBuffer::ParsedPacketBufferVector &vec)
UDPPacketMerger()
Constructor of udp packet merger.
sick::datastructure::ParsedPacketBuffer::ParsedPacketBufferVector getSortedParsedPacketBufferForIdentification(const sick::datastructure::DatagramHeader &header)
std::vector< ParsedPacketBuffer > ParsedPacketBufferVector
sick::datastructure::PacketBuffer m_deployed_packet_buffer
Contains the contents of a udp datagram header. Used to match the datagrams together to form a comple...
std::vector< uint8_t > removeHeaderFromParsedPacketBuffer(const sick::datastructure::ParsedPacketBuffer::ParsedPacketBufferVector &vec)


sick_safetyscanners
Author(s): Lennart Puck
autogenerated on Fri Apr 2 2021 02:45:41