OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    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.
    void Flush (bool doForce=false)
     Flush collected string to messenger.
     StreamBuffer (const StreamBuffer &theOther)
     Formal copy constructor.
    template<typename T>
    StreamBuffer & operator<< (const T &theArg)
     Wrapper for operator << of the stream.
    StreamBuffer & operator<< (std::ostream &(*)(std::ostream &))
     Operator << for manipulators of ostream (ends, endl, flush), flushes the buffer (sends the message).
    Standard_SStream & Stream ()
     Access to the stream object.
     operator Standard_OStream & ()
     Cast to OStream&.
    Message_Messenger * Messenger ()
     Access to the messenger.

    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 ( bool doForce = 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: