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

MultiplexStream Class Reference

This is a special ostream that forwards the data that is written to it to any number of other sources, for instance other ostreams, or explicitly to a disk file or to system logging utilities. More...

#include <multiplexStream.h>

List of all members.

Public Member Functions

 MultiplexStream ()
void add_ostream (ostream *out, bool delete_later=false)
 Adds the indicated generic ostream to the multiplex output.

bool add_stdio_file (FILE *file, bool close_when_done)
 Adds the given file, previously opened using the C stdio library, to the multiplex output.

void add_standard_output ()
 Adds the standard output channel.

bool add_file (Filename file)
 Adds the given file to the multiplex output.

void add_system_debug ()
 Adds the system debug output the the multiplex output.

void flush ()
 Forces out all output that hasn't yet been written.


Private Attributes

MultiplexStreamBuf _msb


Detailed Description

This is a special ostream that forwards the data that is written to it to any number of other sources, for instance other ostreams, or explicitly to a disk file or to system logging utilities.

It's a very handy thing to set Notify to refer to when running in batch mode.

Definition at line 50 of file multiplexStream.h.


Constructor & Destructor Documentation

MultiplexStream::MultiplexStream  )  [inline]
 

Definition at line 30 of file multiplexStream.I.

References _msb, MultiplexStreamBuf::add_output(), MultiplexStreamBuf::BT_none, INLINE, NULL, and MultiplexStreamBuf::OT_ostream.


Member Function Documentation

bool MultiplexStream::add_file Filename  file  )  [inline]
 

Adds the given file to the multiplex output.

The file is opened in append mode with line buffering. Returns false if the file cannot be opened.

Definition at line 99 of file multiplexStream.I.

References _msb, MultiplexStreamBuf::add_output(), MultiplexStreamBuf::BT_line, INLINE, and MultiplexStreamBuf::OT_system_debug.

void MultiplexStream::add_ostream ostream *  out,
bool  delete_later = false
[inline]
 

Adds the indicated generic ostream to the multiplex output.

The ostream will receive whatever data is sent to the pipe.

Definition at line 47 of file multiplexStream.I.

References _msb, MultiplexStreamBuf::add_output(), MultiplexStreamBuf::BT_line, INLINE, NULL, and MultiplexStreamBuf::OT_ostream.

void MultiplexStream::add_standard_output  )  [inline]
 

Adds the standard output channel.

Definition at line 80 of file multiplexStream.I.

bool MultiplexStream::add_stdio_file FILE *  file,
bool  close_when_done
[inline]
 

Adds the given file, previously opened using the C stdio library, to the multiplex output.

Definition at line 64 of file multiplexStream.I.

References _msb.

void MultiplexStream::add_system_debug  )  [inline]
 

Adds the system debug output the the multiplex output.

This may map to a syslog or some such os-specific output system. It may do nothing on a particular system.

Presently, this maps only to OutputDebugString() on Windows.

Definition at line 135 of file multiplexStream.I.

void MultiplexStream::flush void   )  [inline]
 

Forces out all output that hasn't yet been written.

Definition at line 149 of file multiplexStream.I.


Member Data Documentation

MultiplexStreamBuf MultiplexStream::_msb [private]
 

Definition at line 63 of file multiplexStream.h.

Referenced by add_file(), add_ostream(), add_stdio_file(), and MultiplexStream().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:52:29 2003 for Panda by doxygen1.3