Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mbilog::PseudoStream Class Reference

An object of this class simulates a std::cout stream. This means messages can be added by using the bit shift operator (<<). Should only be used by the macros defined in the file mbilog.h. More...

#include <mbilog.h>

Collaboration diagram for mbilog::PseudoStream:

Public Member Functions

 PseudoStream (int level, const char *filePath, int lineNumber, const char *functionName)
 
 ~PseudoStream ()
 The message which is stored in the member ss is written to the backend. More...
 
template<class T >
PseudoStreamoperator<< (const T &data)
 Definition of the bit shift operator for this class. More...
 
template<class T >
PseudoStreamoperator<< (T &data)
 Definition of the bit shift operator for this class (for non const data). More...
 
PseudoStreamoperator<< (std::ostream &(*func)(std::ostream &))
 Definition of the bit shift operator for this class (for functions). More...
 
PseudoStreamoperator() (const char *category)
 Sets the category of this PseudoStream object. If there already is a category it is appended, seperated by a dot. More...
 
PseudoStreamoperator() (bool enabled)
 Enables/disables the PseudoStream. If set to false parsing and output is suppressed. More...
 

Protected Attributes

bool disabled
 
LogMessage msg
 
std::stringstream ss
 

Detailed Description

An object of this class simulates a std::cout stream. This means messages can be added by using the bit shift operator (<<). Should only be used by the macros defined in the file mbilog.h.

Definition at line 69 of file mbilog.h.

Constructor & Destructor Documentation

mbilog::PseudoStream::PseudoStream ( int  level,
const char *  filePath,
int  lineNumber,
const char *  functionName 
)
inline

Definition at line 77 of file mbilog.h.

mbilog::PseudoStream::~PseudoStream ( )
inline

The message which is stored in the member ss is written to the backend.

Definition at line 83 of file mbilog.h.

References mbilog::DistributeToBackends(), MBILOG_MODULENAME, mbilog::LogMessage::message, and mbilog::LogMessage::moduleName.

Member Function Documentation

PseudoStream& mbilog::PseudoStream::operator() ( const char *  category)
inline

Sets the category of this PseudoStream object. If there already is a category it is appended, seperated by a dot.

Definition at line 145 of file mbilog.h.

References mbilog::LogMessage::category.

PseudoStream& mbilog::PseudoStream::operator() ( bool  enabled)
inline

Enables/disables the PseudoStream. If set to false parsing and output is suppressed.

Definition at line 157 of file mbilog.h.

template<class T >
PseudoStream& mbilog::PseudoStream::operator<< ( const T &  data)
inline

Definition of the bit shift operator for this class.

Definition at line 95 of file mbilog.h.

template<class T >
PseudoStream& mbilog::PseudoStream::operator<< ( T &  data)
inline

Definition of the bit shift operator for this class (for non const data).

Definition at line 112 of file mbilog.h.

PseudoStream& mbilog::PseudoStream::operator<< ( std::ostream &(*)(std::ostream &)  func)
inline

Definition of the bit shift operator for this class (for functions).

Definition at line 128 of file mbilog.h.

Member Data Documentation

bool mbilog::PseudoStream::disabled
protected

Definition at line 72 of file mbilog.h.

LogMessage mbilog::PseudoStream::msg
protected

Definition at line 73 of file mbilog.h.

std::stringstream mbilog::PseudoStream::ss
protected

Definition at line 74 of file mbilog.h.


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