Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

lfc::BufferedOutput Class Template Reference

A generalized buffered output stream. More...

Inheritance diagram for lfc::BufferedOutput::

lfc::Object lfc::_OutputFilter< TYPE, TYPE > lfc::_Output lfc::_Server List of all members.

Public Methods

 BufferedOutput (_Output< TYPE > &rOutputBase, long bufferSize=DEFAULT_BUFFER_SIZE)
 ~BufferedOutput () throw ()
virtual void setBufferSize (long bufferSize)
 Sets the size of the buffer to be used. More...

virtual long bufferSize () const throw ()
 
Returns:
the buffer size in units of TYPE.
More...


virtual long write (const TYPE *buffer, long count, bool ignored=true)
 Writes to the buffered stream. More...

virtual void flush ()
 Flushes the output. More...

virtual void push (const TYPE &value)
 Pushes a single element of TYPE onto the stream. More...

virtual void resetOutput ()
 \brief Resets output for this stream. More...


Static Public Attributes

const long DEFAULT_BUFFER_SIZE = 1024L
 the default buffer size. More...


Protected Methods

virtual void writeToBases ()
 Does the job of writing to the underlying streams. More...


Protected Attributes

TYPE * m_buffer
 the actual buffer. More...

long m_bufferSize
 its size. More...

long m_bufferUse
 how much has been written into the buffer. More...


Detailed Description

template<class TYPE>
class lfc::BufferedOutput< TYPE >

A generalized buffered output stream.

Note:
Do not mix read calls of BufferedOutput with reads of the underlying streams.
Note:
It is absolutely imperitive that flush() is called before a BufferedOutput object is destroyed.


Constructor & Destructor Documentation

template<class TYPE>
lfc::BufferedOutput< TYPE >::BufferedOutput _Output< TYPE > &    rOutputBase,
long    bufferSize = DEFAULT_BUFFER_SIZE
[inline]
 

Parameters:
rOutputBase  the base output that is going to be buffered
bufferSize  the size of buffer to use

template<class TYPE>
lfc::BufferedOutput< TYPE >::~BufferedOutput   throw () [inline]
 


Member Function Documentation

template<class TYPE>
virtual void lfc::BufferedOutput< TYPE >::setBufferSize long    bufferSize [inline, virtual]
 

Sets the size of the buffer to be used.

This flushes the remaining data before creating the new buffer.

Parameters:
bufferSize  the size to set it to

template<class TYPE>
virtual long lfc::BufferedOutput< TYPE >::bufferSize   const throw () [inline, virtual]
 

Returns:
the buffer size in units of TYPE.

template<class TYPE>
long lfc::BufferedOutput< TYPE >::write const TYPE *    buffer,
long    count,
bool    ignored = true
[virtual]
 

Writes to the buffered stream.

Parameters:
buffer  the data to write
count  the number of TYPE items to write
ignored  an ignored boolean parameter inherited from _OutputFilter
Returns:
the number of TYPE objects written

Reimplemented from lfc::_Output.

template<class TYPE>
virtual void lfc::BufferedOutput< TYPE >::flush   [inline, virtual]
 

Flushes the output.

Reimplemented from lfc::_Output.

template<class TYPE>
virtual void lfc::BufferedOutput< TYPE >::push const TYPE &    value [inline, virtual]
 

Pushes a single element of TYPE onto the stream.

Parameters:
value  the value to write

Reimplemented from lfc::_Output.

template<class TYPE>
void lfc::BufferedOutput< TYPE >::resetOutput   [virtual]
 

\brief Resets output for this stream.

Reimplemented from lfc::_Output.

template<class TYPE>
void lfc::BufferedOutput< TYPE >::writeToBases   [protected, virtual]
 

Does the job of writing to the underlying streams.


Member Data Documentation

template<class TYPE>
const long lfc::BufferedOutput::DEFAULT_BUFFER_SIZE = 1024L [static]
 

the default buffer size.

template<class TYPE>
TYPE* lfc::BufferedOutput::m_buffer [protected]
 

the actual buffer.

template<class TYPE>
long lfc::BufferedOutput::m_bufferSize [protected]
 

its size.

template<class TYPE>
long lfc::BufferedOutput::m_bufferUse [protected]
 

how much has been written into the buffer.


The documentation for this class was generated from the following file:
Generated on Fri Jan 25 03:12:55 2002 for LFC2 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001