Medical Imaging Interaction Toolkit  2023.04.00
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 60 of file mbilog.h.

Constructor & Destructor Documentation

◆ PseudoStream()

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

Definition at line 68 of file mbilog.h.

◆ ~PseudoStream()

mbilog::PseudoStream::~PseudoStream ( )
inline

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

Definition at line 74 of file mbilog.h.

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

Member Function Documentation

◆ operator()() [1/2]

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

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

Definition at line 148 of file mbilog.h.

◆ operator()() [2/2]

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 136 of file mbilog.h.

References mbilog::LogMessage::category.

◆ operator<<() [1/3]

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

Definition of the bit shift operator for this class.

Definition at line 86 of file mbilog.h.

◆ operator<<() [2/3]

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

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

Definition at line 119 of file mbilog.h.

◆ operator<<() [3/3]

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 103 of file mbilog.h.

Member Data Documentation

◆ disabled

bool mbilog::PseudoStream::disabled
protected

Definition at line 63 of file mbilog.h.

◆ msg

LogMessage mbilog::PseudoStream::msg
protected

Definition at line 64 of file mbilog.h.

◆ ss

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

Definition at line 65 of file mbilog.h.


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