TCPPacketMerger.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_TCPPACKETMERGER_H
36 #define SICK_SAFETYSCANNERS_DATA_PROCESSING_TCPPACKETMERGER_H
37 
39 
41 
42 #include <mutex>
43 #include <vector>
44 
45 namespace sick {
46 namespace data_processing {
47 
52 {
53 public:
58 
64  bool isComplete() const;
65 
71  bool isEmpty() const;
72 
82 
89 
95  uint32_t getTargetSize() const;
96 
102  void setTargetSize(const uint32_t& targetSize);
103 
104 private:
107 
108  std::vector<sick::datastructure::PacketBuffer> m_buffer_vector;
109  std::mutex m_buffer_mutex;
110  uint32_t m_targetSize;
111 
112  bool addToMap(const sick::datastructure::PacketBuffer& new_packet);
113  bool deployPacketIfComplete();
114 
115  uint32_t getCurrentSize();
116  bool deployPacket();
117 };
118 
119 } // namespace data_processing
120 } // namespace sick
121 
122 #endif // SICK_SAFETYSCANNERS_DATA_PROCESSING_TCPPACKETMERGER_H
sick::datastructure::PacketBuffer getDeployedPacketBuffer()
Gets the latest complete data packet.
A packetbuffer for the raw data from the sensor.
Definition: PacketBuffer.h:61
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.
bool isComplete() const
Check if the packet is complete.
bool addToMap(const sick::datastructure::PacketBuffer &new_packet)
sick::datastructure::PacketBuffer m_deployed_packet_buffer
TCPPacketMerger()
Constructor of merger.
void setTargetSize(const uint32_t &targetSize)
Sets the target size of a data packet.
std::vector< sick::datastructure::PacketBuffer > m_buffer_vector
Merges incoming tcp packets together to get a complete data packet.


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