AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
|
Implement a streambuf sub-class that can write messages via the DRAMA Logger 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 DRAMA Logger.
You can use this to create an std::ostream which can be used to output to the log file.
Implementation based on code in "The C++ Standard Library", Second Edition, N.M. Josuttis, 2012. Pages 837/838.
From that:
(C) Copyright Nicolai M. Josuttis 2012. Permission to copy, use, modify, sell and distribute this software is granted provided this copyright notice appears in all copies. This software is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.
But note, most of the code copied here is very much the minimum required to use the streambuf class.
#include "logger.hh"
Inherits std::streambuf.
Public Member Functions | |
LogStreamBuf (const LogStreamBuf &source)=delete | |
Copy constructor - deleted. | |
LogStreamBuf (Logger *theLogger, unsigned level, const std::string &prefix) | |
Construct a LogStreamBuf object. | |
LogStreamBuf (LogStreamBuf &&source) noexcept | |
Move copy constructor. | |
virtual | ~LogStreamBuf () |
Destroy the LogStreamBuf, any remaining output is sent. | |
LogStreamBuf & | operator= (const LogStreamBuf &rhs)=delete |
Assignment operator - deleted. | |
LogStreamBuf & | operator= (LogStreamBuf &&rhs) noexcept |
Move assignment operator. | |
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tony.farrell@mq.edu.au
Generated by