charon-core  0.3.1
SplitStream Class Reference

This class wraps a list of output streams and pipes output made to a splitstream instance to all of these output streams. More...

#include <charon-core/SplitStream.h>

Inheritance diagram for SplitStream:

Public Member Functions

 SplitStream ()
 Default constructor. More...
 
 SplitStream (std::ostream &stream)
 Assign one stream to output list. More...
 
 SplitStream (std::ostream &stream1, std::ostream &stream2)
 Assign two streams to output list. More...
 
 SplitStream (std::vector< std::ostream * > &streamList)
 Assing a whole list of streams. More...
 
virtual ~SplitStream ()
 Default destructor.
 
Stream assignment (see constructors for details)
void assign (std::ostream &stream=std::cout)
 
void assign (std::ostream &stream1, std::ostream &stream2)
 
void assign (std::vector< std::ostream * > &streamsList)
 

Private Member Functions

void charon_core_LOCAL updateBuf (std::vector< std::streambuf * > buffers)
 Set new buffers. More...
 

Private Attributes

SplitStreamBuf_buffer
 pointer to output stream buffer
 
std::vector< std::streambuf * > _buffers
 buffer array
 

Detailed Description

Definition at line 69 of file SplitStream.h.

Constructor & Destructor Documentation

SplitStream::SplitStream ( )

Use no output stream.
Make sure you call assign() before using this SplitStream.

Definition at line 77 of file SplitStream.cpp.

SplitStream::SplitStream ( std::ostream &  stream)
Parameters
streamstream to pipe output to

Definition at line 87 of file SplitStream.cpp.

References _buffer, and _buffers.

SplitStream::SplitStream ( std::ostream &  stream1,
std::ostream &  stream2 
)
Parameters
stream1fist output stream to assign
stream2second stream to assign

Definition at line 96 of file SplitStream.cpp.

References _buffer, and _buffers.

SplitStream::SplitStream ( std::vector< std::ostream * > &  streamList)
Parameters
streamListlist of streams to assign

Definition at line 106 of file SplitStream.cpp.

References _buffer, and _buffers.

Member Function Documentation

void SplitStream::updateBuf ( std::vector< std::streambuf * >  buffers)
private
Parameters
buffersnew buffers to set

Definition at line 122 of file SplitStream.cpp.

References _buffer.


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