S3FC project page S3FC home page

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

s3_generic_streambuf Class Reference

A generic buffered stream buffer. More...

#include <s3_logger.h>

Inheritance diagram for s3_generic_streambuf:

Inheritance graph
[legend]
List of all members.

Public Methods

 s3_generic_streambuf (const unsigned int put_buffer_len=S3_DEFAULT_OSTREAM_BUF_SIZE)
 Constructor. More...

virtual ~s3_generic_streambuf ()
 The destructor makes sure the entire buffer contents is written to the device before the buffer goes out of scope. More...

virtual int overflow (int ch)
 Necessary overload for streambuf::overflow(). More...

virtual int sync (void)
 Necessary overload for streambuf::sync(). More...


Private Methods

virtual void write_to_device ()=0
 This method should be overridden to write a null-terminated string pointed to by pbase() to the device this class is specialised for. More...


Private Attributes

std::vector< char > putbuffer
 Put buffer. More...


Detailed Description

A generic buffered stream buffer.

This is an abstract class used by other specialised streambuffer specialisations. TODO: Fix implementation to not use std::vector.

See also:
The overall operation of the S3 Logging System.
Author:
Francois Swanepoel <swanepoel@stonethree.com>

Definition at line 144 of file s3_logger.h.


Constructor & Destructor Documentation

s3_generic_streambuf::s3_generic_streambuf const unsigned int    put_buffer_len = S3_DEFAULT_OSTREAM_BUF_SIZE [inline]
 

Constructor.

Parameters:
put_buffer_len  The size of the internal storage buffer.

Definition at line 164 of file s3_logger.h.

References putbuffer, and S3_DEFAULT_OSTREAM_BUF_SIZE.

virtual s3_generic_streambuf::~s3_generic_streambuf   [inline, virtual]
 

The destructor makes sure the entire buffer contents is written to the device before the buffer goes out of scope.

Definition at line 175 of file s3_logger.h.


Member Function Documentation

virtual int s3_generic_streambuf::overflow int    ch [inline, virtual]
 

Necessary overload for streambuf::overflow().

Definition at line 185 of file s3_logger.h.

References sync.

virtual int s3_generic_streambuf::sync void    [inline, virtual]
 

Necessary overload for streambuf::sync().

Definition at line 197 of file s3_logger.h.

References putbuffer, and write_to_device.

Referenced by overflow, s3_log_buffer::~s3_log_buffer, s3_msgb_log_buffer::~s3_msgb_log_buffer, and s3_syslog_buffer::~s3_syslog_buffer.

virtual void s3_generic_streambuf::write_to_device   [private, pure virtual]
 

This method should be overridden to write a null-terminated string pointed to by pbase() to the device this class is specialised for.

Implemented in s3_syslog_buffer.

Referenced by sync.


Member Data Documentation

std::vector<char> s3_generic_streambuf::putbuffer [private]
 

Put buffer.

Definition at line 149 of file s3_logger.h.

Referenced by s3_generic_streambuf, and sync.


The documentation for this class was generated from the following file:
Send comments to: s3fc@stonethree.com SourceForge Logo