AAO DRAMA/DRAMA2 C++ Interface
Public Member Functions | List of all members
drama::logging::LogStream Class Reference

Detailed Description

A class used to allow logging using C++ Stream features.

Create one of these items using Logger::CreateLogStream(). You then write to it using C++ Stream functions. When the object's flush() method or its destructor is invoked, the results are written to the log file.

#include "logger.hh"

Public Member Functions

 LogStream (const LogStream &source)=delete
 Copy constructor - deleted. More...
 
 LogStream (LogStream &&source) noexcept
 Move copy constructor. More...
 
 ~LogStream ()
 Destroy the object, are flushing the contents to the log file. More...
 
LogStreamflush ()
 Flush the LogStream message to the log file. More...
 
template<class T >
LogStreamoperator<< (const T &t)
 Write information to the log. More...
 
LogStreamoperator= (const LogStream &rhs)=delete
 Assignment operator - deleted. More...
 
LogStreamoperator= (LogStream &&rhs) noexcept
 Move assignment operator. More...
 

Constructor & Destructor Documentation

drama::logging::LogStream::LogStream ( const LogStream source)
delete

Copy constructor - deleted.

A Move constructor is available and deals with most relevant cases of interest.

drama::logging::LogStream::LogStream ( LogStream &&  source)
inlinenoexcept

Move copy constructor.

Often optimized out using the "copy elision" rule.

drama::logging::LogStream::~LogStream ( )
inline

Destroy the object, are flushing the contents to the log file.

Member Function Documentation

LogStream& drama::logging::LogStream::flush ( )

Flush the LogStream message to the log file.

template<class T >
LogStream& drama::logging::LogStream::operator<< ( const T &  t)
inline

Write information to the log.

Anything supported as a type by sstreams can written using this operator, except that you can't use std::endl manipulator. To use manimulatpors such as std::setw(), first include iomanip.

Results are not written to the log file until flush() is invoked or the object destructor is invoked.

The time tag applied to the log entries is as per the flushing. The DRAMA action context is as per the creation of the LogStream object.

param t The information to be added.

LogStream& drama::logging::LogStream::operator= ( const LogStream rhs)
delete

Assignment operator - deleted.

Not possible to assign LogStream objects.

A Move assignment operator is available and deals with most relevant cases of interest.

LogStream& drama::logging::LogStream::operator= ( LogStream &&  rhs)
inlinenoexcept

Move assignment operator.

Often optimized out using the "copy elision" rule.


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

Click here for the DRAMA home page and here for the AAO home page.

For more information, contact tjf@aao.gov.au 

Generated on Mon Feb 22 2016 15:57:53 for AAO DRAMA/DRAMA2 C++ Interface by doxygen 1.8.10