HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions
v1::packet Class Reference

#include <hikogui/net/packet.hpp>

Public Member Functions

 packet (ptrdiff_t nrBytes) noexcept
 Allocate an empty packet of a certain size.
 
 packet (packet const &rhs) noexcept=delete
 
packet operator= (packet const &rhs) noexcept=delete
 
 packet (packet &&rhs) noexcept
 
std::byte * begin () noexcept
 
std::byte * end () noexcept
 
ptrdiff_t readSize () const noexcept
 How many bytes can be read from this buffer.
 
ptrdiff_t writeSize () const noexcept
 How many bytes can still be written to this buffer.
 
bool pushed () const noexcept
 Should this packet be pushed onto the network.
 
void push () noexcept
 Mark this packet to be pushed to the network.
 
void write (ptrdiff_t nrBytes) noexcept
 Commit a write.
 
void read (ptrdiff_t nrBytes) noexcept
 Consume a read.
 

Detailed Description

A network message or stream buffer.

Constructor & Destructor Documentation

◆ packet()

v1::packet::packet ( ptrdiff_t nrBytes)
inlinenoexcept

Allocate an empty packet of a certain size.

Member Function Documentation

◆ push()

void v1::packet::push ( )
inlinenoexcept

Mark this packet to be pushed to the network.

◆ pushed()

bool v1::packet::pushed ( ) const
inlinenoexcept

Should this packet be pushed onto the network.

◆ read()

void v1::packet::read ( ptrdiff_t nrBytes)
inlinenoexcept

Consume a read.

Should be called after data has been copied from this buffer.

◆ readSize()

ptrdiff_t v1::packet::readSize ( ) const
inlinenoexcept

How many bytes can be read from this buffer.

◆ write()

void v1::packet::write ( ptrdiff_t nrBytes)
inlinenoexcept

Commit a write.

Should be called after data has been copied into this buffer.

◆ writeSize()

ptrdiff_t v1::packet::writeSize ( ) const
inlinenoexcept

How many bytes can still be written to this buffer.


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