BLOCXX_NAMESPACE::BaseStreamBuffer Class Reference

#include <BaseStreamBuffer.hpp>

Inheritance diagram for BLOCXX_NAMESPACE::BaseStreamBuffer:

BLOCXX_NAMESPACE::IOIFCStreamBuffer BLOCXX_NAMESPACE::OStringStreamBuf BLOCXX_NAMESPACE::SocketStreamBuffer List of all members.

Public Member Functions

 BaseStreamBuffer (size_t bufSize=BASE_BUF_SIZE, const char *direction="io")
 Create a base stream buffer.
 ~BaseStreamBuffer ()

Protected Member Functions

int underflow ()
std::streamsize xsputn (const char *s, std::streamsize n)
virtual int overflow (int c)
virtual int sync ()
virtual void initBuffers ()
virtual void initGetBuffer ()
virtual void initPutBuffer ()
virtual int buffer_to_device (const char *c, int n)
 Writes the buffer to the "device".
virtual int buffer_from_device (char *c, int n)
 Fill the buffer from the "device".

Private Member Functions

int buffer_in ()
int buffer_out ()
 BaseStreamBuffer (const BaseStreamBuffer &arg)
BaseStreamBufferoperator= (const BaseStreamBuffer &arg)

Private Attributes

std::streamsize m_bufSize
char * m_inputBuffer
char * m_outputBuffer

Detailed Description

Definition at line 56 of file BaseStreamBuffer.hpp.


Constructor & Destructor Documentation

BLOCXX_NAMESPACE::BaseStreamBuffer::BaseStreamBuffer size_t  bufSize = BASE_BUF_SIZE,
const char *  direction = "io"
 

Create a base stream buffer.

TODO: Make a different version of this ctor that doesn't use strings. Use an enum instead.

Parameters:
bufSize size of buffer
direction "in", "out", or "io"

Definition at line 49 of file BaseStreamBuffer.cpp.

References initGetBuffer(), m_bufSize, and m_inputBuffer.

BLOCXX_NAMESPACE::BaseStreamBuffer::~BaseStreamBuffer  ) 
 

Definition at line 85 of file BaseStreamBuffer.cpp.

References m_inputBuffer, and m_outputBuffer.

BLOCXX_NAMESPACE::BaseStreamBuffer::BaseStreamBuffer const BaseStreamBuffer arg  )  [private]
 


Member Function Documentation

int BLOCXX_NAMESPACE::BaseStreamBuffer::buffer_from_device char *  c,
int  n
[protected, virtual]
 

Fill the buffer from the "device".

Parameters:
c A pointer to the beginning of the buffer
n The number of bytes to be read into the buffer.
Returns:
-1 if no bytes are able to be read from the "device" (for instance, end of input stream). Otherwise, return the number of bytes read into the buffer.

Reimplemented in BLOCXX_NAMESPACE::IOIFCStreamBuffer.

Definition at line 238 of file BaseStreamBuffer.cpp.

References BLOCXX_ASSERT.

Referenced by buffer_in().

int BLOCXX_NAMESPACE::BaseStreamBuffer::buffer_in  )  [private]
 

Definition at line 214 of file BaseStreamBuffer.cpp.

References buffer_from_device(), m_bufSize, and m_inputBuffer.

Referenced by underflow().

int BLOCXX_NAMESPACE::BaseStreamBuffer::buffer_out  )  [private]
 

Definition at line 98 of file BaseStreamBuffer.cpp.

References buffer_to_device(), m_outputBuffer, and BLOCXX_NAMESPACE::Exception::what().

Referenced by overflow(), and sync().

int BLOCXX_NAMESPACE::BaseStreamBuffer::buffer_to_device const char *  c,
int  n
[protected, virtual]
 

Writes the buffer to the "device".

Parameters:
c A pointer to the start of the buffer
n the number of bytes to write
Returns:
-1 if error, 0 if the entire buffer was written.

Reimplemented in BLOCXX_NAMESPACE::IOIFCStreamBuffer, and BLOCXX_NAMESPACE::OStringStreamBuf.

Definition at line 231 of file BaseStreamBuffer.cpp.

References BLOCXX_ASSERT.

Referenced by buffer_out().

void BLOCXX_NAMESPACE::BaseStreamBuffer::initBuffers  )  [protected, virtual]
 

Definition at line 67 of file BaseStreamBuffer.cpp.

References initGetBuffer(), and initPutBuffer().

Referenced by BLOCXX_NAMESPACE::IOIFCStreamBuffer::reset().

void BLOCXX_NAMESPACE::BaseStreamBuffer::initGetBuffer  )  [protected, virtual]
 

Definition at line 80 of file BaseStreamBuffer.cpp.

References m_inputBuffer.

Referenced by BaseStreamBuffer(), and initBuffers().

void BLOCXX_NAMESPACE::BaseStreamBuffer::initPutBuffer  )  [protected, virtual]
 

Definition at line 74 of file BaseStreamBuffer.cpp.

References m_bufSize, and m_outputBuffer.

Referenced by initBuffers().

BaseStreamBuffer& BLOCXX_NAMESPACE::BaseStreamBuffer::operator= const BaseStreamBuffer arg  )  [private]
 

int BLOCXX_NAMESPACE::BaseStreamBuffer::overflow int  c  )  [protected, virtual]
 

Definition at line 131 of file BaseStreamBuffer.cpp.

References buffer_out().

int BLOCXX_NAMESPACE::BaseStreamBuffer::sync  )  [protected, virtual]
 

Definition at line 92 of file BaseStreamBuffer.cpp.

References buffer_out().

Referenced by BLOCXX_NAMESPACE::OStringStream::c_str(), BLOCXX_NAMESPACE::OStringStream::length(), BLOCXX_NAMESPACE::OStringStream::releaseString(), BLOCXX_NAMESPACE::OStringStream::toString(), and BLOCXX_NAMESPACE::IOIFCStreamBuffer::~IOIFCStreamBuffer().

int BLOCXX_NAMESPACE::BaseStreamBuffer::underflow  )  [protected]
 

Definition at line 173 of file BaseStreamBuffer.cpp.

References buffer_in(), and BLOCXX_NAMESPACE::Exception::what().

std::streamsize BLOCXX_NAMESPACE::BaseStreamBuffer::xsputn const char *  s,
std::streamsize  n
[protected]
 

Definition at line 151 of file BaseStreamBuffer.cpp.

References i.


Member Data Documentation

std::streamsize BLOCXX_NAMESPACE::BaseStreamBuffer::m_bufSize [private]
 

Definition at line 100 of file BaseStreamBuffer.hpp.

Referenced by BaseStreamBuffer(), buffer_in(), and initPutBuffer().

char* BLOCXX_NAMESPACE::BaseStreamBuffer::m_inputBuffer [private]
 

Definition at line 101 of file BaseStreamBuffer.hpp.

Referenced by BaseStreamBuffer(), buffer_in(), initGetBuffer(), and ~BaseStreamBuffer().

char* BLOCXX_NAMESPACE::BaseStreamBuffer::m_outputBuffer [private]
 

Definition at line 102 of file BaseStreamBuffer.hpp.

Referenced by buffer_out(), initPutBuffer(), and ~BaseStreamBuffer().


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 15:39:10 2006 for blocxx by  doxygen 1.4.6