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 <vector>
43 
44 namespace sick {
45 namespace data_processing {
46 
51 {
52 public:
57 
63  bool isComplete() const;
64 
70  bool isEmpty() const;
71 
81 
88 
94  uint32_t getTargetSize() const;
95 
101  void setTargetSize(const uint32_t& targetSize);
102 
103 private:
106 
107  std::vector<sick::datastructure::PacketBuffer> m_buffer_vector;
108  uint32_t m_targetSize;
109 
110  bool addToMap(const sick::datastructure::PacketBuffer& newPacket);
111  bool deployPacketIfComplete();
112 
113  uint32_t getCurrentSize() const;
114  bool deployPacket();
115 };
116 
117 } // namespace data_processing
118 } // namespace sick
119 
120 #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.
sick::datastructure::PacketBuffer m_deployed_packet_buffer
TCPPacketMerger()
Constructor of merger.
bool addToMap(const sick::datastructure::PacketBuffer &newPacket)
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 Thu May 9 2019 02:41:08