The queue is of fixed size and does FIFO. When the queue becomes full the eldest packet behind the head is dropped, ie since the head may be in transit.
|typedef list<const RipPacket<A>*> QueueRep|
| PacketQueue ()
| ~PacketQueue ()
|void enqueue_packet (const RipPacket<A>* pkt)
Place packet in ready to sent queue. The supplied packet is expected to have been allocated with the standard new operator and will be destructed by the packet queue when it is dropped or popped from the queue.
This may cause older packets in the queue to be dropped to make sufficient space for new packet.
|bool empty ()
Returns: true if no packets are queued, false otherwise.
|const RipPacket<A>* head ()
Peek at head packet if it exists.
Returns: pointer to head packet if it exists, 0 otherwise.
|void pop_head ()
Remove head packet.
|bool drop_old ()
Discard packet behind head packet to make space for new packets.
Returns: true if an old packet was dropped, false if no packets dropped.
|void flush_packets ()
Flush queued packets.
|void set_max_buffered_bytes (uint32_t mb)
Set the maximum amount of data to buffer.
|uint32_t max_buffered_bytes ()
Get the maximum amount of buffered data.
|uint32_t buffered_bytes ()
Get the current amount of buffered data.
|uint32_t drop_count ()
Get the number of packets dropped from queue.
|void reset_drop_count ()
Reset packet drop counter.