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

#include <itkLoggerThreadWrapper.h>

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

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 41 of file itkLoggerThreadWrapper.h.

Public Types

using ConstPointer = SmartPointer< const Self >
 
using DelayType = unsigned int
 
enum  OperationType {
  SET_PRIORITY_LEVEL,
  SET_LEVEL_FOR_FLUSHING,
  ADD_LOG_OUTPUT,
  WRITE
}
 
using OutputType = typename SimpleLoggerType::OutputType
 
using Pointer = SmartPointer< Self >
 
using PriorityLevelType = typename SimpleLoggerType::PriorityLevelType
 
using Self = LoggerThreadWrapper
 
using Superclass = SimpleLoggerType
 

Public Member Functions

void AddLogOutput (OutputType *output) override
 
virtual ::itk::LightObject::Pointer CreateAnother () const
 
void Flush () override
 
virtual DelayType GetDelay () const
 
PriorityLevelType GetLevelForFlushing () const override
 
virtual const char * GetNameOfClass () const
 
PriorityLevelType GetPriorityLevel () const override
 
virtual void SetDelay (DelayType delay)
 
void SetLevelForFlushing (PriorityLevelType level) override
 
void SetPriorityLevel (PriorityLevelType level) override
 
void Write (PriorityLevelType 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 ThreadFunction ()
 
 ~LoggerThreadWrapper () override
 

Private Types

using LevelContainerType = std::queue< PriorityLevelType >
 
using MessageContainerType = std::queue< std::string >
 
using OperationContainerType = std::queue< OperationType >
 
using OutputContainerType = std::queue< typename OutputType::Pointer >
 

Private Attributes

DelayType m_Delay
 
LevelContainerType m_LevelQ
 
MessageContainerType m_MessageQ
 
std::mutex m_Mutex
 
OperationContainerType m_OperationQ
 
OutputContainerType m_OutputQ
 
bool m_TerminationRequested
 
std::thread m_Thread
 

Member Typedef Documentation

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

Definition at line 48 of file itkLoggerThreadWrapper.h.

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

Definition at line 58 of file itkLoggerThreadWrapper.h.

template<typename SimpleLoggerType >
using itk::LoggerThreadWrapper< SimpleLoggerType >::LevelContainerType = std::queue< PriorityLevelType >
private

Definition at line 118 of file itkLoggerThreadWrapper.h.

template<typename SimpleLoggerType >
using itk::LoggerThreadWrapper< SimpleLoggerType >::MessageContainerType = std::queue< std::string >
private

Definition at line 116 of file itkLoggerThreadWrapper.h.

template<typename SimpleLoggerType >
using itk::LoggerThreadWrapper< SimpleLoggerType >::OperationContainerType = std::queue< OperationType >
private

Definition at line 114 of file itkLoggerThreadWrapper.h.

template<typename SimpleLoggerType >
using itk::LoggerThreadWrapper< SimpleLoggerType >::OutputContainerType = std::queue< typename OutputType::Pointer >
private

Definition at line 120 of file itkLoggerThreadWrapper.h.

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

Definition at line 56 of file itkLoggerThreadWrapper.h.

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

Definition at line 47 of file itkLoggerThreadWrapper.h.

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

Definition at line 57 of file itkLoggerThreadWrapper.h.

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

Definition at line 45 of file itkLoggerThreadWrapper.h.

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

Definition at line 46 of file itkLoggerThreadWrapper.h.

Member Enumeration Documentation

template<typename SimpleLoggerType >
enum itk::LoggerThreadWrapper::OperationType

Definition of types of operations for LoggerThreadWrapper.

Enumerator
SET_PRIORITY_LEVEL 
SET_LEVEL_FOR_FLUSHING 
ADD_LOG_OUTPUT 
WRITE 

Definition at line 61 of file itkLoggerThreadWrapper.h.

Constructor & Destructor Documentation

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

Constructor

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

Destructor

Member Function Documentation

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

Registers another output stream with the multiple output.

template<typename SimpleLoggerType >
virtual::itk::LightObject::Pointer itk::LoggerThreadWrapper< SimpleLoggerType >::CreateAnother ( ) const
template<typename SimpleLoggerType >
void itk::LoggerThreadWrapper< SimpleLoggerType >::Flush ( )
override
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.

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

Run-time type information (and related methods).

template<typename SimpleLoggerType >
PriorityLevelType 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

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

New macro for creation of through a Smart Pointer

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

Print contents of a LoggerThreadWrapper

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.

template<typename SimpleLoggerType >
void itk::LoggerThreadWrapper< SimpleLoggerType >::SetLevelForFlushing ( PriorityLevelType  level)
override
template<typename SimpleLoggerType >
void itk::LoggerThreadWrapper< SimpleLoggerType >::SetPriorityLevel ( PriorityLevelType  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

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

Member Data Documentation

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

Definition at line 136 of file itkLoggerThreadWrapper.h.

template<typename SimpleLoggerType >
LevelContainerType itk::LoggerThreadWrapper< SimpleLoggerType >::m_LevelQ
private

Definition at line 130 of file itkLoggerThreadWrapper.h.

template<typename SimpleLoggerType >
MessageContainerType itk::LoggerThreadWrapper< SimpleLoggerType >::m_MessageQ
private

Definition at line 128 of file itkLoggerThreadWrapper.h.

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

Definition at line 134 of file itkLoggerThreadWrapper.h.

template<typename SimpleLoggerType >
OperationContainerType itk::LoggerThreadWrapper< SimpleLoggerType >::m_OperationQ
private

Definition at line 126 of file itkLoggerThreadWrapper.h.

template<typename SimpleLoggerType >
OutputContainerType itk::LoggerThreadWrapper< SimpleLoggerType >::m_OutputQ
private

Definition at line 132 of file itkLoggerThreadWrapper.h.

template<typename SimpleLoggerType >
bool itk::LoggerThreadWrapper< SimpleLoggerType >::m_TerminationRequested
private

Definition at line 124 of file itkLoggerThreadWrapper.h.

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

Definition at line 122 of file itkLoggerThreadWrapper.h.


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