Open CASCADE Technology  7.5.0
Public Member Functions

Message_Messenger::StreamBuffer Class Reference

Auxiliary class wrapping std::stringstream thus allowing constructing message via stream interface, and putting result into its creator Message_Messenger within destructor. More...

#include <Message_Messenger.hxx>

Public Member Functions

 ~StreamBuffer ()
 Destructor flushing constructed message. More...
 
void Flush (Standard_Boolean doForce=Standard_False)
 Flush collected string to messenger. More...
 
 StreamBuffer (const StreamBuffer &theOther)
 Formal copy constructor. More...
 
template<typename T >
StreamBufferoperator<< (const T &theArg)
 Wrapper for operator << of the stream. More...
 
StreamBufferoperator<< (std::ostream &(*)(std::ostream &))
 Operator << for manipulators of ostream (ends, endl, flush), flushes the buffer (sends the message) More...
 
Standard_SStreamStream ()
 Access to the stream object. More...
 
 operator Standard_OStream & ()
 Cast to OStream&. More...
 
Message_MessengerMessenger ()
 Access to the messenger. More...
 

Detailed Description

Auxiliary class wrapping std::stringstream thus allowing constructing message via stream interface, and putting result into its creator Message_Messenger within destructor.

It is intended to be used either as temporary object or as local variable, note that content will be lost if it is copied.

Constructor & Destructor Documentation

◆ ~StreamBuffer()

Message_Messenger::StreamBuffer::~StreamBuffer ( )
inline

Destructor flushing constructed message.

◆ StreamBuffer()

Message_Messenger::StreamBuffer::StreamBuffer ( const StreamBuffer theOther)
inline

Formal copy constructor.

Since buffer is intended for use as temporary object or local variable, copy (or move) is needed only formally to be able to return the new instance from relevant creation method. In practice it should never be called because modern compilers create such instances in place. However note that if this constructor is called, the buffer content (string) will not be copied (move is not supported for std::stringstream class on old compilers such as gcc 4.4, msvc 9).

Member Function Documentation

◆ Flush()

void Message_Messenger::StreamBuffer::Flush ( Standard_Boolean  doForce = Standard_False)
inline

Flush collected string to messenger.

◆ Messenger()

Message_Messenger* Message_Messenger::StreamBuffer::Messenger ( )
inline

Access to the messenger.

◆ operator Standard_OStream &()

Message_Messenger::StreamBuffer::operator Standard_OStream & ( )
inline

Cast to OStream&.

◆ operator<<() [1/2]

template<typename T >
StreamBuffer& Message_Messenger::StreamBuffer::operator<< ( const T &  theArg)
inline

Wrapper for operator << of the stream.

◆ operator<<() [2/2]

StreamBuffer& Message_Messenger::StreamBuffer::operator<< ( std::ostream &  *)(std::ostream &)
inline

Operator << for manipulators of ostream (ends, endl, flush), flushes the buffer (sends the message)

◆ Stream()

Standard_SStream& Message_Messenger::StreamBuffer::Stream ( )
inline

Access to the stream object.


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