ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
itk::LoggerThreadWrapper< SimpleLoggerType > Class Template Reference

#include <itkLoggerThreadWrapper.h>

Detailed Description

template<typename SimpleLoggerType>
class itk::LoggerThreadWrapper< SimpleLoggerType >

Used for providing logging service as a separate thread.

Author
Hee-Su Kim, Compute Science Dept. Kyungpook National University, ISIS Center, Georgetown University.

Definition at line 68 of file itkLoggerThreadWrapper.h.

+ Inheritance diagram for itk::LoggerThreadWrapper< SimpleLoggerType >:
+ Collaboration diagram for itk::LoggerThreadWrapper< SimpleLoggerType >:

Public Types

using ConstPointer = SmartPointer< const Self >
 
using DelayType = unsigned int
 
using OperationEnum = LoggerThreadWrapperEnums::Operation
 
using OutputType = typename SimpleLoggerType::OutputType
 
using Pointer = SmartPointer< Self >
 
using PriorityLevelEnum = typename SimpleLoggerType::PriorityLevelEnum
 
using Self = LoggerThreadWrapper
 
using Superclass = SimpleLoggerType
 

Public Member Functions

void AddLogOutput (OutputType *output) override
 
void Flush () override
 
virtual DelayType GetDelay () const
 
PriorityLevelEnum GetLevelForFlushing () const override
 
const char * GetNameOfClass () const override
 
PriorityLevelEnum GetPriorityLevel () const override
 
virtual void SetDelay (DelayType delay)
 
void SetLevelForFlushing (PriorityLevelEnum level) override
 
void SetPriorityLevel (PriorityLevelEnum level) override
 
void Write (PriorityLevelEnum level, std::string const &content) override
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 LoggerThreadWrapper ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
void PrivateFlush () override
 
void ThreadFunction ()
 
 ~LoggerThreadWrapper () override
 

Private Attributes

DelayType m_Delay {}
 
std::queue< PriorityLevelEnumm_LevelQ {}
 
std::queue< std::string > m_MessageQ {}
 
std::mutex m_Mutex {}
 
std::queue< OperationEnumm_OperationQ {}
 
std::queue< typename OutputType::Pointerm_OutputQ {}
 
std::atomic< bool > m_TerminationRequested {}
 
std::thread m_Thread {}
 

Member Typedef Documentation

◆ ConstPointer

template<typename SimpleLoggerType >
using itk::LoggerThreadWrapper< SimpleLoggerType >::ConstPointer = SmartPointer<const Self>

Definition at line 74 of file itkLoggerThreadWrapper.h.

◆ DelayType

template<typename SimpleLoggerType >
using itk::LoggerThreadWrapper< SimpleLoggerType >::DelayType = unsigned int

Definition at line 84 of file itkLoggerThreadWrapper.h.

◆ OperationEnum

template<typename SimpleLoggerType >
using itk::LoggerThreadWrapper< SimpleLoggerType >::OperationEnum = LoggerThreadWrapperEnums::Operation

Definition at line 86 of file itkLoggerThreadWrapper.h.

◆ OutputType

template<typename SimpleLoggerType >
using itk::LoggerThreadWrapper< SimpleLoggerType >::OutputType = typename SimpleLoggerType::OutputType

Definition at line 82 of file itkLoggerThreadWrapper.h.

◆ Pointer

template<typename SimpleLoggerType >
using itk::LoggerThreadWrapper< SimpleLoggerType >::Pointer = SmartPointer<Self>

Definition at line 73 of file itkLoggerThreadWrapper.h.

◆ PriorityLevelEnum

template<typename SimpleLoggerType >
using itk::LoggerThreadWrapper< SimpleLoggerType >::PriorityLevelEnum = typename SimpleLoggerType::PriorityLevelEnum

Definition at line 83 of file itkLoggerThreadWrapper.h.

◆ Self

template<typename SimpleLoggerType >
using itk::LoggerThreadWrapper< SimpleLoggerType >::Self = LoggerThreadWrapper

Definition at line 71 of file itkLoggerThreadWrapper.h.

◆ Superclass

template<typename SimpleLoggerType >
using itk::LoggerThreadWrapper< SimpleLoggerType >::Superclass = SimpleLoggerType

Definition at line 72 of file itkLoggerThreadWrapper.h.

Constructor & Destructor Documentation

◆ LoggerThreadWrapper()

template<typename SimpleLoggerType >
itk::LoggerThreadWrapper< SimpleLoggerType >::LoggerThreadWrapper ( )
protected

Constructor

◆ ~LoggerThreadWrapper()

template<typename SimpleLoggerType >
itk::LoggerThreadWrapper< SimpleLoggerType >::~LoggerThreadWrapper ( )
overrideprotected

Destructor

Member Function Documentation

◆ AddLogOutput()

template<typename SimpleLoggerType >
void itk::LoggerThreadWrapper< SimpleLoggerType >::AddLogOutput ( OutputType output)
override

Registers another output stream with the multiple output.

◆ Flush()

template<typename SimpleLoggerType >
void itk::LoggerThreadWrapper< SimpleLoggerType >::Flush ( )
override

◆ GetDelay()

template<typename SimpleLoggerType >
virtual DelayType itk::LoggerThreadWrapper< SimpleLoggerType >::GetDelay ( ) const
virtual

Get the delay in milliseconds between checks to see if there are any low priority messages to be processed.

◆ GetLevelForFlushing()

template<typename SimpleLoggerType >
PriorityLevelEnum itk::LoggerThreadWrapper< SimpleLoggerType >::GetLevelForFlushing ( ) const
override

◆ GetNameOfClass()

template<typename SimpleLoggerType >
const char* itk::LoggerThreadWrapper< SimpleLoggerType >::GetNameOfClass ( ) const
override

◆ GetPriorityLevel()

template<typename SimpleLoggerType >
PriorityLevelEnum itk::LoggerThreadWrapper< SimpleLoggerType >::GetPriorityLevel ( ) const
override

Get the priority level for the current logger. Only messages that have priorities equal or greater than the one set here will be posted to the current outputs

◆ New()

template<typename SimpleLoggerType >
static Pointer itk::LoggerThreadWrapper< SimpleLoggerType >::New ( )
static

New macro for creation of through a Smart Pointer

◆ PrintSelf()

template<typename SimpleLoggerType >
void itk::LoggerThreadWrapper< SimpleLoggerType >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotected

Print contents of a LoggerThreadWrapper

◆ PrivateFlush()

template<typename SimpleLoggerType >
void itk::LoggerThreadWrapper< SimpleLoggerType >::PrivateFlush ( )
overrideprotected

◆ SetDelay()

template<typename SimpleLoggerType >
virtual void itk::LoggerThreadWrapper< SimpleLoggerType >::SetDelay ( DelayType  delay)
virtual

Set the delay in milliseconds between checks to see if there are any low priority messages to be processed.

◆ SetLevelForFlushing()

template<typename SimpleLoggerType >
void itk::LoggerThreadWrapper< SimpleLoggerType >::SetLevelForFlushing ( PriorityLevelEnum  level)
override

◆ SetPriorityLevel()

template<typename SimpleLoggerType >
void itk::LoggerThreadWrapper< SimpleLoggerType >::SetPriorityLevel ( PriorityLevelEnum  level)
override

Set the priority level for the current logger. Only messages that have priorities equal or greater than the one set here will be posted to the current outputs

◆ ThreadFunction()

template<typename SimpleLoggerType >
void itk::LoggerThreadWrapper< SimpleLoggerType >::ThreadFunction ( )
protected

◆ Write()

template<typename SimpleLoggerType >
void itk::LoggerThreadWrapper< SimpleLoggerType >::Write ( PriorityLevelEnum  level,
std::string const &  content 
)
override

Member Data Documentation

◆ m_Delay

template<typename SimpleLoggerType >
DelayType itk::LoggerThreadWrapper< SimpleLoggerType >::m_Delay {}
private

Definition at line 169 of file itkLoggerThreadWrapper.h.

◆ m_LevelQ

template<typename SimpleLoggerType >
std::queue<PriorityLevelEnum> itk::LoggerThreadWrapper< SimpleLoggerType >::m_LevelQ {}
private

Definition at line 163 of file itkLoggerThreadWrapper.h.

◆ m_MessageQ

template<typename SimpleLoggerType >
std::queue<std::string> itk::LoggerThreadWrapper< SimpleLoggerType >::m_MessageQ {}
private

Definition at line 161 of file itkLoggerThreadWrapper.h.

◆ m_Mutex

template<typename SimpleLoggerType >
std::mutex itk::LoggerThreadWrapper< SimpleLoggerType >::m_Mutex {}
mutableprivate

Definition at line 167 of file itkLoggerThreadWrapper.h.

◆ m_OperationQ

template<typename SimpleLoggerType >
std::queue<OperationEnum> itk::LoggerThreadWrapper< SimpleLoggerType >::m_OperationQ {}
private

Definition at line 159 of file itkLoggerThreadWrapper.h.

◆ m_OutputQ

template<typename SimpleLoggerType >
std::queue<typename OutputType::Pointer> itk::LoggerThreadWrapper< SimpleLoggerType >::m_OutputQ {}
private

Definition at line 165 of file itkLoggerThreadWrapper.h.

◆ m_TerminationRequested

template<typename SimpleLoggerType >
std::atomic<bool> itk::LoggerThreadWrapper< SimpleLoggerType >::m_TerminationRequested {}
private

Definition at line 157 of file itkLoggerThreadWrapper.h.

◆ m_Thread

template<typename SimpleLoggerType >
std::thread itk::LoggerThreadWrapper< SimpleLoggerType >::m_Thread {}
private

Definition at line 155 of file itkLoggerThreadWrapper.h.


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