Public Member Functions | Private Member Functions | Private Attributes | List of all members
sick::data_processing::TCPPacketMerger Class Reference

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. More...
 
sick::datastructure::PacketBuffer getDeployedPacketBuffer ()
 Gets the latest complete data packet. More...
 
uint32_t getTargetSize () const
 Returns the expected target size of a complete data packet. More...
 
bool isComplete () const
 Check if the packet is complete. More...
 
bool isEmpty () const
 Checks if the buffer vector is empty. More...
 
void setTargetSize (const uint32_t &targetSize)
 Sets the target size of a data packet. More...
 
 TCPPacketMerger ()
 Constructor of merger. More...
 

Private Member Functions

bool addToMap (const sick::datastructure::PacketBuffer &new_packet)
 
bool deployPacket ()
 
bool deployPacketIfComplete ()
 
uint32_t getCurrentSize ()
 

Private Attributes

std::mutex m_buffer_mutex
 
std::vector< sick::datastructure::PacketBufferm_buffer_vector
 
sick::datastructure::PacketBuffer m_deployed_packet_buffer
 
bool m_is_complete
 
uint32_t m_targetSize
 

Detailed Description

Merges incoming tcp packets together to get a complete data packet.

Definition at line 51 of file TCPPacketMerger.h.

Constructor & Destructor Documentation

sick::data_processing::TCPPacketMerger::TCPPacketMerger ( )

Constructor of merger.

Definition at line 40 of file TCPPacketMerger.cpp.

Member Function Documentation

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.

Parameters
bufferThe new tcp packet.
Returns
True if the data packet is complete with the new packet.

Definition at line 62 of file TCPPacketMerger.cpp.

bool sick::data_processing::TCPPacketMerger::addToMap ( const sick::datastructure::PacketBuffer new_packet)
private

Definition at line 77 of file TCPPacketMerger.cpp.

bool sick::data_processing::TCPPacketMerger::deployPacket ( )
private

Definition at line 100 of file TCPPacketMerger.cpp.

bool sick::data_processing::TCPPacketMerger::deployPacketIfComplete ( )
private

Definition at line 90 of file TCPPacketMerger.cpp.

uint32_t sick::data_processing::TCPPacketMerger::getCurrentSize ( )
private

Definition at line 125 of file TCPPacketMerger.cpp.

sick::datastructure::PacketBuffer sick::data_processing::TCPPacketMerger::getDeployedPacketBuffer ( )

Gets the latest complete data packet.

Returns
The latest complete data packet.

Definition at line 56 of file TCPPacketMerger.cpp.

uint32_t sick::data_processing::TCPPacketMerger::getTargetSize ( ) const

Returns the expected target size of a complete data packet.

Returns
The target size of a complete data packet.

Definition at line 115 of file TCPPacketMerger.cpp.

bool sick::data_processing::TCPPacketMerger::isComplete ( ) const

Check if the packet is complete.

Returns
True if the packet is complete.

Definition at line 46 of file TCPPacketMerger.cpp.

bool sick::data_processing::TCPPacketMerger::isEmpty ( ) const

Checks if the buffer vector is empty.

Returns
True if the buffer vector is empty.

Definition at line 51 of file TCPPacketMerger.cpp.

void sick::data_processing::TCPPacketMerger::setTargetSize ( const uint32_t &  targetSize)

Sets the target size of a data packet.

Parameters
targetSizeThe new target size of a data packet.

Definition at line 120 of file TCPPacketMerger.cpp.

Member Data Documentation

std::mutex sick::data_processing::TCPPacketMerger::m_buffer_mutex
private

Definition at line 109 of file TCPPacketMerger.h.

std::vector<sick::datastructure::PacketBuffer> sick::data_processing::TCPPacketMerger::m_buffer_vector
private

Definition at line 108 of file TCPPacketMerger.h.

sick::datastructure::PacketBuffer sick::data_processing::TCPPacketMerger::m_deployed_packet_buffer
private

Definition at line 106 of file TCPPacketMerger.h.

bool sick::data_processing::TCPPacketMerger::m_is_complete
private

Definition at line 105 of file TCPPacketMerger.h.

uint32_t sick::data_processing::TCPPacketMerger::m_targetSize
private

Definition at line 110 of file TCPPacketMerger.h.


The documentation for this class was generated from the following files:


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