itom
Loading...
Searching...
No Matches
ito::QDebugStream Class Reference

#include <qDebugStream.h>

Inheritance diagram for ito::QDebugStream:

Signals

void flushStream (QString, ito::tStreamMessageType)
 

Public Member Functions

 QDebugStream (std::ostream &stream, ito::tStreamMessageType)
 constructor
 
 ~QDebugStream ()
 destructor
 

Protected Member Functions

virtual std::basic_streambuf< char >::int_type overflow (int_type v)
 this method overwrites a corresponding method in basic_streambuf class and is invoked, if buffer risks to overflow
 
virtual std::streamsize xsputn (const char *p, std::streamsize n)
 method invoked if new content has been added to stream
 

Private Attributes

std::ostream & m_stream
 
std::streambuf * m_old_buf
 
std::string m_string
 
ito::tStreamMessageType msg_type
 
uint32 m_randWaitThreshold
 

Detailed Description

class inherits from std::basic_streambuf and is able to transform a stream, like std::cout or std::cerr, into emitted signals

Constructor & Destructor Documentation

◆ QDebugStream()

ito::QDebugStream::QDebugStream ( std::ostream & stream,
ito::tStreamMessageType type )

constructor

initializes this instance and stores actual content of stream in m_old_buf

Parameters
streamStream of type std::ostream which should be observed
typemessage type of enumeration tMsgType which corresponds to the stream
lineBreakstring representation of line break, default:
Returns
description
See also
tMsgType

◆ ~QDebugStream()

ito::QDebugStream::~QDebugStream ( )

destructor

destroys this instance and the stream observation and emits remaining string in the buffer. Restores m_old_buf to the stream.

Member Function Documentation

◆ flushStream

void ito::QDebugStream::flushStream ( QString ,
ito::tStreamMessageType  )
signal

signal emits a string which appeared in the observed stream together with indicating the corresponding message type

◆ overflow()

std::basic_streambuf< char >::int_type ito::QDebugStream::overflow ( int_type v)
protectedvirtual

this method overwrites a corresponding method in basic_streambuf class and is invoked, if buffer risks to overflow

this method overwrites a corresponding method in basic_streambuf class and is invoked, if buffer risks to overflow

Member Data Documentation

◆ m_old_buf

std::streambuf* ito::QDebugStream::m_old_buf
private

content of stream at time when this instance starts the observation of the stream is stored here and re-given to the stream, when this instance is destroyed

◆ m_stream

std::ostream& ito::QDebugStream::m_stream
private

standard-ostream which is observed by this instance

◆ m_string

std::string ito::QDebugStream::m_string
private

buffer string, containing parts of the stream which have not been emitted yet

◆ msg_type

ito::tStreamMessageType ito::QDebugStream::msg_type
private

message type of enumeration ito::tStreamMessageType


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