#include <multiplexStreamBuf.h>
Public Types | |
enum | BufferType { BT_none, BT_line } |
enum | OutputType { OT_ostream, OT_stdio, OT_system_debug } |
Public Member Functions | |
MultiplexStreamBuf () | |
virtual | ~MultiplexStreamBuf () |
void | add_output (BufferType buffer_type, OutputType output_type, ostream *out=(ostream *) NULL, FILE *fout=(FILE *) NULL, bool owns_obj=false) |
Adds the indicated output destinition to the set of things that will be written to when characters are output to the MultiplexStream. | |
void | flush () |
Forces out all output that hasn't yet been written. | |
Protected Member Functions | |
virtual int | overflow (int c) |
Called by the system ostream implementation when its internal buffer is filled, plus one character. | |
virtual int | sync () |
Called by the system ostream implementation when the buffer should be flushed to output (for instance, on destruction). | |
Private Types | |
typedef pvector< Output > | Outputs |
Private Member Functions | |
void | write_chars (const char *start, int length, bool flush) |
An internal function called by sync() and overflow() to store one or more characters written to the stream into the memory buffer. | |
Private Attributes | |
Outputs | _outputs |
string | _line_buffer |
Definition at line 45 of file multiplexStreamBuf.h.
|
Definition at line 88 of file multiplexStreamBuf.h. |
|
Definition at line 50 of file multiplexStreamBuf.h. |
|
Definition at line 55 of file multiplexStreamBuf.h. |
|
Definition at line 109 of file multiplexStreamBuf.cxx. References _outputs, MultiplexStreamBuf::Output::close(), and sync(). |
|
Definition at line 125 of file multiplexStreamBuf.cxx. References MultiplexStreamBuf::Output::_buffer_type, MultiplexStreamBuf::Output::_fout, MultiplexStreamBuf::Output::_out, MultiplexStreamBuf::Output::_output_type, _outputs, and MultiplexStreamBuf::Output::_owns_obj. |
|
Adds the indicated output destinition to the set of things that will be written to when characters are output to the MultiplexStream.
Definition at line 149 of file multiplexStreamBuf.cxx. References write_chars(). Referenced by MultiplexStream::add_file(), MultiplexStream::add_ostream(), and MultiplexStream::MultiplexStream(). |
|
Forces out all output that hasn't yet been written.
Definition at line 177 of file multiplexStreamBuf.cxx. References write_chars(). |
|
Called by the system ostream implementation when its internal buffer is filled, plus one character.
Definition at line 196 of file multiplexStreamBuf.cxx. References streamsize, and write_chars(). |
|
Called by the system ostream implementation when the buffer should be flushed to output (for instance, on destruction).
Definition at line 230 of file multiplexStreamBuf.cxx. References _line_buffer, length, and size_t. Referenced by MultiplexStreamBuf(). |
|
An internal function called by sync() and overflow() to store one or more characters written to the stream into the memory buffer. It is assumed that there is only one thread at a time running this code; it is the responsibility of the caller to grab the _lock mutex before calling this. Definition at line 269 of file multiplexStreamBuf.cxx. Referenced by add_output(), flush(), and overflow(). |
|
Definition at line 91 of file multiplexStreamBuf.h. Referenced by sync(). |
|
Definition at line 89 of file multiplexStreamBuf.h. Referenced by MultiplexStreamBuf(), and ~MultiplexStreamBuf(). |