ug4
ug::OStreamBufferSplitter Class Reference

forwards data written to this stream-buffer to other stream buffers. More...

#include <ostream_buffer_splitter.h>

+ Inheritance diagram for ug::OStreamBufferSplitter:

Public Member Functions

void flush ()
 
 OStreamBufferSplitter ()
 
 OStreamBufferSplitter (std::streambuf *buf1, std::streambuf *buf2)
 
virtual int_type overflow (int_type c=traits_type::eof())
 
void set_buffers (std::streambuf *buf1, std::streambuf *buf2)
 
 ~OStreamBufferSplitter ()
 

Private Attributes

char_type m_buf [BUF_SIZE]
 
std::streambuf * m_buf1
 
std::streambuf * m_buf2
 

Static Private Attributes

static const int BUF_SIZE = 128
 

Detailed Description

forwards data written to this stream-buffer to other stream buffers.

Make sure that the buffers are initialized and ready for writing, before you intend to write anything to the buffer.

Constructor & Destructor Documentation

◆ OStreamBufferSplitter() [1/2]

ug::OStreamBufferSplitter::OStreamBufferSplitter ( )

References BUF_SIZE, and m_buf.

◆ OStreamBufferSplitter() [2/2]

ug::OStreamBufferSplitter::OStreamBufferSplitter ( std::streambuf *  buf1,
std::streambuf *  buf2 
)

References set_buffers().

◆ ~OStreamBufferSplitter()

ug::OStreamBufferSplitter::~OStreamBufferSplitter ( )

References flush().

Member Function Documentation

◆ flush()

void ug::OStreamBufferSplitter::flush ( )

◆ overflow()

ostream::int_type ug::OStreamBufferSplitter::overflow ( int_type  c = traits_type::eof())
virtual

References BUF_SIZE, m_buf, m_buf1, and m_buf2.

◆ set_buffers()

void ug::OStreamBufferSplitter::set_buffers ( std::streambuf *  buf1,
std::streambuf *  buf2 
)

References flush(), m_buf1, and m_buf2.

Referenced by ug::LogAssistant::init(), and OStreamBufferSplitter().

Member Data Documentation

◆ BUF_SIZE

const int ug::OStreamBufferSplitter::BUF_SIZE = 128
staticprivate

◆ m_buf

char_type ug::OStreamBufferSplitter::m_buf[BUF_SIZE]
private

◆ m_buf1

std::streambuf* ug::OStreamBufferSplitter::m_buf1
private

Referenced by flush(), overflow(), and set_buffers().

◆ m_buf2

std::streambuf* ug::OStreamBufferSplitter::m_buf2
private

Referenced by flush(), overflow(), and set_buffers().


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