Class TCPPacketMerger

Class Documentation

class TCPPacketMerger

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

Public Functions

TCPPacketMerger() = delete

Constructor of merger.

TCPPacketMerger(std::size_t target_size)
TCPPacketMerger(const TCPPacketMerger&) = delete
TCPPacketMerger &operator=(const TCPPacketMerger&) = delete
bool isComplete() const

Check if the packet is complete.

Returns

True if the packet is complete.

bool isEmpty() const

Checks if the buffer vector is empty.

Returns

True if the buffer vector is empty.

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.

Parameters

buffer – The new tcp packet.

Returns

True if the data packet is complete with the new packet.

sick::datastructure::PacketBuffer getDeployedPacketBuffer()

Gets the latest complete data packet.

Returns

The latest complete data packet.

std::size_t getTargetSize() const

Returns the expected target size of a complete data packet.

Returns

The target size of a complete data packet.

void setTargetSize(std::size_t target_size)

Sets the target size of a data packet.

Parameters

targetSize – The new target size of a data packet.