blocxx
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

BLOCXX_NAMESPACE::BaseStreamBuffer Class Reference

#include <BaseStreamBuffer.hpp>

Inheritance diagram for BLOCXX_NAMESPACE::BaseStreamBuffer:
BLOCXX_NAMESPACE::FileBuf BLOCXX_NAMESPACE::IOIFCStreamBuffer BLOCXX_NAMESPACE::OStringStreamBuf BLOCXX_NAMESPACE::IFileStream BLOCXX_NAMESPACE::SocketStreamBuffer

List of all members.

Public Types

enum  EDirectionFlag { E_IN, E_OUT, E_IN_OUT }

Public Member Functions

 BaseStreamBuffer (EDirectionFlag direction, size_t bufSize=BASE_BUF_SIZE)
 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 57 of file BaseStreamBuffer.hpp.


Member Enumeration Documentation

Enumerator:
E_IN 
E_OUT 
E_IN_OUT 

Definition at line 60 of file BaseStreamBuffer.hpp.


Constructor & Destructor Documentation

BLOCXX_NAMESPACE::BaseStreamBuffer::BaseStreamBuffer ( EDirectionFlag  direction,
size_t  bufSize = BASE_BUF_SIZE 
)

Create a base stream buffer.

Parameters:
directionE_IN, E_OUT, E_IN_OUT
bufSizesize of buffer

Definition at line 51 of file BaseStreamBuffer.cpp.

References E_IN, E_IN_OUT, E_OUT, initGetBuffer(), initPutBuffer(), m_bufSize, m_inputBuffer, and m_outputBuffer.

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:
cA pointer to the beginning of the buffer
nThe 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.
Exceptions:
IOExceptionon failure.

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

Definition at line 190 of file BaseStreamBuffer.cpp.

References BLOCXX_ASSERT.

Referenced by buffer_in().

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

Definition at line 166 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(), and m_outputBuffer.

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:
cA pointer to the start of the buffer
nthe number of bytes to write
Returns:
-1 if error, 0 if the entire buffer was written.

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

Definition at line 183 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 BaseStreamBuffer(), and initBuffers().

BaseStreamBuffer& BLOCXX_NAMESPACE::BaseStreamBuffer::operator= ( const BaseStreamBuffer arg) [private]
int BLOCXX_NAMESPACE::BaseStreamBuffer::overflow ( int  c) [protected, virtual]

Definition at line 107 of file BaseStreamBuffer.cpp.

References buffer_out().

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

Definition at line 149 of file BaseStreamBuffer.cpp.

References buffer_in().

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

Definition at line 127 of file BaseStreamBuffer.cpp.

References i.


Member Data Documentation

Definition at line 107 of file BaseStreamBuffer.hpp.

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


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