AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
Public Member Functions | List of all members
drama::MessageUserStreamBuf< T > Class Template Reference

Detailed Description

template<class T>
class drama::MessageUserStreamBuf< T >

Implement a streambuf sub-class that can write messages via the DRAMA MessageUser interface.


This class implements std::streambuf, which allows it to be used as an output stream buffer for character based output streams (std::ostream). Messages are output via the MessageUser() method of an object supplied to the constructor. This would typically be a a sub-class of drama::MessageHandler or drama::thread::TMessHandler.

std::ostream messStream(&messBuf);
messStream << "Message for user" << std::endl;
Implement a streambuf sub-class that can write messages via the DRAMA MessageUser interface.
Definition messagehandler.hh:754
void CreateRunDramaTask()
Create and run a DRAMA task, with standard exception handling.
Definition task.hh:1322
Note
A new DRAMA message is sent (MsgOut()) each time the buffer is flushed, which will happen if a std::endl is output or if the number of queue characters exceeds MSG_C_LEN. In the later case, the message will be broken between multiple log events.
Warning
Any text not flushed when the destructor is invoked will be flushed by the destructor. In some cases, this may result in messages appearing outside the expected order. It is recommended all message be terminated by a std::endl to avoid this happening.

Implementation based on code in "The C++ Standard Library", Second Edition, N.M. Josuttis, Pages 837/838.

Author
Tony Farrell, AAO $Revision$ $Date$
Template Parameters
TA class which provides a MessageUser() interface.

#include "messagehandler.hh"

Inherits std::streambuf.

Public Member Functions

 MessageUserStreamBuf (T &actionObj)
 Construct a MessageUserStreamBuf object.
 
virtual ~MessageUserStreamBuf ()
 Destroy the MessgaeUserStream, any remaining output is sent.
 

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