Merges incoming tcp packets together to get a complete data packet. More...
#include <TCPPacketMerger.h>
Public Member Functions | |
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. | |
sick::datastructure::PacketBuffer | getDeployedPacketBuffer () |
Gets the latest complete data packet. | |
uint32_t | getTargetSize () const |
Returns the expected target size of a complete data packet. | |
bool | isComplete () const |
Check if the packet is complete. | |
bool | isEmpty () const |
Checks if the buffer vector is empty. | |
void | setTargetSize (const uint32_t &targetSize) |
Sets the target size of a data packet. | |
TCPPacketMerger () | |
Constructor of merger. | |
Private Member Functions | |
bool | addToMap (const sick::datastructure::PacketBuffer &newPacket) |
bool | deployPacket () |
bool | deployPacketIfComplete () |
uint32_t | getCurrentSize () const |
Private Attributes | |
std::vector < sick::datastructure::PacketBuffer > | m_buffer_vector |
sick::datastructure::PacketBuffer | m_deployed_packet_buffer |
bool | m_is_complete |
uint32_t | m_targetSize |
Merges incoming tcp packets together to get a complete data packet.
Definition at line 50 of file TCPPacketMerger.h.
Constructor of merger.
Definition at line 40 of file TCPPacketMerger.cpp.
bool sick::data_processing::TCPPacketMerger::addTCPPacket | ( | const sick::datastructure::PacketBuffer & | buffer | ) |
Adds a new tcp packet to the merger. Returns true if this tcp packet completes a data packet.
buffer | The new tcp packet. |
Definition at line 63 of file TCPPacketMerger.cpp.
bool sick::data_processing::TCPPacketMerger::addToMap | ( | const sick::datastructure::PacketBuffer & | newPacket | ) | [private] |
Definition at line 75 of file TCPPacketMerger.cpp.
bool sick::data_processing::TCPPacketMerger::deployPacket | ( | ) | [private] |
Definition at line 98 of file TCPPacketMerger.cpp.
bool sick::data_processing::TCPPacketMerger::deployPacketIfComplete | ( | ) | [private] |
Definition at line 88 of file TCPPacketMerger.cpp.
uint32_t sick::data_processing::TCPPacketMerger::getCurrentSize | ( | ) | const [private] |
Definition at line 124 of file TCPPacketMerger.cpp.
sick::datastructure::PacketBuffer sick::data_processing::TCPPacketMerger::getDeployedPacketBuffer | ( | ) |
Gets the latest complete data packet.
Definition at line 57 of file TCPPacketMerger.cpp.
uint32_t sick::data_processing::TCPPacketMerger::getTargetSize | ( | ) | const |
Returns the expected target size of a complete data packet.
Definition at line 114 of file TCPPacketMerger.cpp.
bool sick::data_processing::TCPPacketMerger::isComplete | ( | ) | const |
Check if the packet is complete.
Definition at line 47 of file TCPPacketMerger.cpp.
bool sick::data_processing::TCPPacketMerger::isEmpty | ( | ) | const |
Checks if the buffer vector is empty.
Definition at line 52 of file TCPPacketMerger.cpp.
void sick::data_processing::TCPPacketMerger::setTargetSize | ( | const uint32_t & | targetSize | ) |
Sets the target size of a data packet.
targetSize | The new target size of a data packet. |
Definition at line 119 of file TCPPacketMerger.cpp.
std::vector<sick::datastructure::PacketBuffer> sick::data_processing::TCPPacketMerger::m_buffer_vector [private] |
Definition at line 107 of file TCPPacketMerger.h.
sick::datastructure::PacketBuffer sick::data_processing::TCPPacketMerger::m_deployed_packet_buffer [private] |
Definition at line 105 of file TCPPacketMerger.h.
bool sick::data_processing::TCPPacketMerger::m_is_complete [private] |
Definition at line 104 of file TCPPacketMerger.h.
uint32_t sick::data_processing::TCPPacketMerger::m_targetSize [private] |
Definition at line 108 of file TCPPacketMerger.h.