RINGBUFFER Class Reference

A Simple First-In-First-Out (FIFO) buffer This is used internally by our SOCKET classes. More...

#include <mi32/ringbuffer.h>

List of all members.

Public Member Functions

 RINGBUFFER ()
 ~RINGBUFFER ()
INT32 Append (const UINT8 *data, INT32 numbytes)
INT32 GetBytes (UINT8 *data, INT32 numbytes)
INT32 GetNumBytes () const
INT32 Peek (const void *&ptr)
INT32 StrChr (char c) const
INT32 UCStrChr (MIUNICODE c) const

Detailed Description

A Simple First-In-First-Out (FIFO) buffer This is used internally by our SOCKET classes.

It's implemented in misystem, but I haven't decided if I should export it or move this include file to mi32p


Constructor & Destructor Documentation

RINGBUFFER::RINGBUFFER (  )  [inline]
RINGBUFFER::~RINGBUFFER (  ) 

Member Function Documentation

INT32 RINGBUFFER::Append ( const UINT8 data,
INT32  numbytes 
)

Append bytes to the end of the buffer.

INT32 RINGBUFFER::GetBytes ( UINT8 data,
INT32  numbytes 
)

Pull bytes from the front of the buffer.

Parameters:
data Buffer to copy bytes into
numbytes The number of bytes to consume. Can be NULL if the data will just be ignored.
Returns:
The number of bytes actually consumed
INT32 RINGBUFFER::GetNumBytes (  )  const

Return the number of bytes currently available in the buffer.

INT32 RINGBUFFER::Peek ( const void *&  ptr  ) 

Peek at the head of the buffer.

Fills in a pointer pointing to the head of the buffer and returns the number of bytes available. Note, the number of bytes returned may not be the total number of bytes available, but it's the number of contiguous bytes that can be accessed through the returned pointer.

INT32 RINGBUFFER::StrChr ( char  c  )  const

Peek at the buffer and find the offset to the given character.

Returns:
Offset to character or -1 if the character isn't in the buffer
INT32 RINGBUFFER::UCStrChr ( MIUNICODE  c  )  const

Peek at the buffer and find the offset to the given unicode character.

Returns:
Offset to character or -1 if the character isn't in the buffer

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

Generated on Sun Oct 7 21:33:48 2012 for TNTsdk 2012 by  doxygen 1.6.1