CMS 3D CMS Logo

lat::ReadBuffer Class Reference

Object for buffering reads for input streaming. More...

#include <Iguana/Utilities/classlib/iotools/ReadBuffer.h>

List of all members.

Public Types

enum  { DEFAULT_SIZE = 4096 }

Public Member Functions

unsigned char * buffer (void) const
IOSize capacity (void) const
unsigned char * current (void) const
unsigned char * end (void) const
void filled (IOSize n)
void get (void *data, IOSize n)
IOSize left (void) const
unsigned char * limit (void) const
ReadBufferoperator= (const ReadBuffer &x)
unsigned char * pback (void) const
 ReadBuffer (const ReadBuffer &x)
 ReadBuffer (IOSize bufsize=DEFAULT_SIZE)
void reset (void)
void skip (IOSize n)
void unget (const void *data, IOSize n)
 ~ReadBuffer (void)

Private Attributes

unsigned char * m_buffer
unsigned char * m_current
unsigned char * m_end
unsigned char * m_limit
unsigned char * m_pback


Detailed Description

Object for buffering reads for input streaming.

Clients should use get() for buffered reads from the store. If left() returns zero to indicate the buffer is exhausted, clients should copy at most capacity() bytes from the external source into end(). They should then call filled() to tell the buffer how much was added, the method updates the other pointers. It is possible to add more data even if left() does not return zero provided capacity() returns non-zero.

The buffer also maintains a push-back area. Bytes already read from the buffer can be "unread", or new data can be pushed back to be accessed on the next get(). Arbitrary amounts of data can be pushed back.

Definition at line 31 of file ReadBuffer.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
DEFAULT_SIZE 

Definition at line 34 of file ReadBuffer.h.

00034 { DEFAULT_SIZE = 4096 };        //< Default buffer size.


Constructor & Destructor Documentation

lat::ReadBuffer::ReadBuffer ( IOSize  bufsize = DEFAULT_SIZE  ) 

lat::ReadBuffer::ReadBuffer ( const ReadBuffer x  ) 

lat::ReadBuffer::~ReadBuffer ( void   ) 


Member Function Documentation

unsigned char* lat::ReadBuffer::buffer ( void   )  const

IOSize lat::ReadBuffer::capacity ( void   )  const

unsigned char* lat::ReadBuffer::current ( void   )  const

unsigned char* lat::ReadBuffer::end ( void   )  const

void lat::ReadBuffer::filled ( IOSize  n  ) 

void lat::ReadBuffer::get ( void data,
IOSize  n 
)

IOSize lat::ReadBuffer::left ( void   )  const

unsigned char* lat::ReadBuffer::limit ( void   )  const

ReadBuffer& lat::ReadBuffer::operator= ( const ReadBuffer x  ) 

unsigned char* lat::ReadBuffer::pback ( void   )  const

void lat::ReadBuffer::reset ( void   ) 

void lat::ReadBuffer::skip ( IOSize  n  ) 

void lat::ReadBuffer::unget ( const void data,
IOSize  n 
)


Member Data Documentation

unsigned char* lat::ReadBuffer::m_buffer [private]

Definition at line 57 of file ReadBuffer.h.

unsigned char* lat::ReadBuffer::m_current [private]

Definition at line 58 of file ReadBuffer.h.

unsigned char* lat::ReadBuffer::m_end [private]

Definition at line 59 of file ReadBuffer.h.

unsigned char* lat::ReadBuffer::m_limit [private]

Definition at line 60 of file ReadBuffer.h.

unsigned char* lat::ReadBuffer::m_pback [private]

Definition at line 61 of file ReadBuffer.h.


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:48:34 2009 for CMSSW by  doxygen 1.5.4