Go to the documentation of this file.
18 #ifndef __LIB_LIBNET_NETWORKQUEUE_H
19 #define __LIB_LIBNET_NETWORKQUEUE_H
NetworkQueue(const Size packetSize, const Size queueSize=MaxPackets)
Constructor.
Log & operator<<(Log &log, const NetworkQueue::Packet &pkt)
Packet * pop()
Retrieve packet with data.
struct NetworkQueue::Packet Packet
Represents a network packet.
static const Size MaxPackets
Maximum number of packets available.
Index< Packet, MaxPackets > m_free
Contains unused packets.
Index is a N-sized array of pointers to items of type T.
Index< Packet, MaxPackets > m_data
Contains packets with data.
void release(Packet *packet)
Put unused packet back.
bool hasData() const
Check if data packets are available.
Networking packet queue implementation.
Packet * get()
Get unused packet.
void push(Packet *packet)
Enqueue packet with data.
unsigned int Size
Any sane size indicator cannot go negative.
virtual ~NetworkQueue()
Destructor.
unsigned char u8
Unsigned 8-bit number.
static const Size PayloadBufferSize
Size of payload memory buffer.
Represents a network packet.
Memory::Range m_payloadRange
Defines the memory range of mapped payload data.