Public Member Functions | Public Attributes

kNet::RingBuffer Class Reference

Implements a byte-based ring buffer (of sorts) of raw bytes. More...

#include <RingBuffer.h>

List of all members.

Public Member Functions

int Size () const
 Returns the number of bytes filled in the ring buffer.
void Compact ()
 Compacts the ring buffer, i.e. moves all bytes to the beginning of the array.
char * Begin ()
 Returns a pointer to the first byte of actual data.
char * End ()
 Returns a pointer to one past the last byte of actual data.
void Inserted (int numBytes)
 Call after having inserted the given amount of bytes to the buffer.
void Consumed (int numBytes)
 Call after having processed the given number of bytes from the buffer.
int TotalFreeBytesLeft () const
 Returns the total number of bytes that can be filled in this structure after compacting.
int ContiguousFreeBytesLeft () const
 Returns the number of bytes that can be added to this structure contiguously, without having to compact.

Public Attributes

int start
 Points to the first used byte.
int end
 Points to the first unused byte.

Detailed Description

Implements a byte-based ring buffer (of sorts) of raw bytes.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines