NAP
Public Member Functions | List of all members
UDPPacket Struct Referencefinal

#include <udppacket.h>

Public Member Functions

 UDPPacket ()=default
 
 UDPPacket (const UDPPacket &other)=default
 
UDPPacketoperator= (const UDPPacket &other)=default
 
 UDPPacket (UDPPacket &&other) noexcept
 
UDPPacketoperator= (UDPPacket &&other) noexcept
 
 UDPPacket (const std::string &string) noexcept
 
 UDPPacket (std::vector< nap::uint8 > &&buffer)
 
 UDPPacket (const std::vector< nap::uint8 > &buffer)
 
const std::vector< nap::uint8 > & data () const
 
size_t size () const
 
std::string toString () const
 

Description

Sent to an endpoint by an UDPClient or created by the UDPServer upon receiving data. Light object that can be copied and moved.

Constructor & Destructor Documentation

◆ UDPPacket() [1/6]

UDPPacket ( )
default

◆ UDPPacket() [2/6]

UDPPacket ( const UDPPacket other)
default

◆ UDPPacket() [3/6]

UDPPacket ( UDPPacket &&  other)
noexcept

◆ UDPPacket() [4/6]

UDPPacket ( const std::string &  string)
noexcept

UDPPacket constructor copies the contents of string into buffer

◆ UDPPacket() [5/6]

UDPPacket ( std::vector< nap::uint8 > &&  buffer)

UDPPacket constructor moves the contents of supplied buffer if rvalue

Parameters
bufferthe buffer to be copied

◆ UDPPacket() [6/6]

UDPPacket ( const std::vector< nap::uint8 > &  buffer)

UDPPacket constructor copies the contents of supplied buffer

Parameters
bufferthe buffer to be copied

Member Function Documentation

◆ data()

const std::vector<nap::uint8>& data ( ) const

returns const reference to vector holding data

Returns
the data

◆ operator=() [1/2]

UDPPacket& operator= ( const UDPPacket other)
default

◆ operator=() [2/2]

UDPPacket& operator= ( UDPPacket &&  other)
noexcept

◆ size()

size_t size ( ) const

returns size of data buffer

Returns
size of data buffer

◆ toString()

std::string toString ( ) const
Returns
string with contents of internal buffer