OW_NAMESPACE::BaseStreamBuffer Class Reference

#include <OW_BaseStreamBuffer.hpp>

Inheritance diagram for OW_NAMESPACE::BaseStreamBuffer:

Inheritance graph
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 54 of file OW_BaseStreamBuffer.hpp.

Constructor & Destructor Documentation

OW_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.

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

Definition at line 47 of file OW_BaseStreamBuffer.cpp.

References initGetBuffer(), m_bufSize, and m_inputBuffer.

OW_NAMESPACE::BaseStreamBuffer::~BaseStreamBuffer  ) 

Definition at line 83 of file OW_BaseStreamBuffer.cpp.

References m_inputBuffer, and m_outputBuffer.

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

Member Function Documentation

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

Fill the buffer from the "device".

c A pointer to the beginning of the buffer
n The number of bytes to be read into the buffer.
-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 OW_NAMESPACE::IOIFCStreamBuffer, OW_NAMESPACE::HTTPChunkedIStreamBuffer, and OW_NAMESPACE::HTTPLengthLimitStreamBuffer.

Definition at line 236 of file OW_BaseStreamBuffer.cpp.

References OW_ASSERT.

Referenced by buffer_in().

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

Definition at line 212 of file OW_BaseStreamBuffer.cpp.

References buffer_from_device(), m_bufSize, and m_inputBuffer.

Referenced by underflow().

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

Definition at line 96 of file OW_BaseStreamBuffer.cpp.

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

Referenced by overflow(), and sync().

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

Writes the buffer to the "device".

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

Reimplemented in OW_NAMESPACE::IOIFCStreamBuffer, OW_NAMESPACE::OStringStreamBuf, and OW_NAMESPACE::HTTPChunkedOStreamBuffer.

Definition at line 229 of file OW_BaseStreamBuffer.cpp.

References OW_ASSERT.

Referenced by buffer_out().

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

Definition at line 65 of file OW_BaseStreamBuffer.cpp.

References initGetBuffer(), and initPutBuffer().

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

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

Definition at line 78 of file OW_BaseStreamBuffer.cpp.

References m_inputBuffer.

Referenced by BaseStreamBuffer(), initBuffers(), OW_NAMESPACE::HTTPChunkedIStreamBuffer::resetInput(), and OW_NAMESPACE::HTTPLengthLimitStreamBuffer::resetLen().

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

Definition at line 72 of file OW_BaseStreamBuffer.cpp.

References m_bufSize, and m_outputBuffer.

Referenced by initBuffers(), and OW_NAMESPACE::HTTPChunkedOStream::termOutput().

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

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

Definition at line 129 of file OW_BaseStreamBuffer.cpp.

References buffer_out().

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

Reimplemented in OW_NAMESPACE::HTTPChunkedOStreamBuffer.

Definition at line 90 of file OW_BaseStreamBuffer.cpp.

References buffer_out().

Referenced by OW_NAMESPACE::OStringStream::c_str(), OW_NAMESPACE::OStringStream::length(), OW_NAMESPACE::OStringStream::releaseString(), OW_NAMESPACE::HTTPChunkedOStreamBuffer::sync(), OW_NAMESPACE::OStringStream::toString(), and OW_NAMESPACE::IOIFCStreamBuffer::~IOIFCStreamBuffer().

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

Definition at line 171 of file OW_BaseStreamBuffer.cpp.

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

std::streamsize OW_NAMESPACE::BaseStreamBuffer::xsputn const char *  s,
std::streamsize  n

Definition at line 149 of file OW_BaseStreamBuffer.cpp.

References i.

Member Data Documentation

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

Definition at line 98 of file OW_BaseStreamBuffer.hpp.

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

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

Definition at line 99 of file OW_BaseStreamBuffer.hpp.

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

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

Definition at line 100 of file OW_BaseStreamBuffer.hpp.

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

The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:13:28 2006 for openwbem by  doxygen 1.4.6