ITK  4.13.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
itk::ThreadLogger Class Reference

#include <itkThreadLogger.h>

+ Inheritance diagram for itk::ThreadLogger:
+ Collaboration diagram for itk::ThreadLogger:

Detailed Description

Providing logging service as a separate thread.

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

Definition at line 40 of file itkThreadLogger.h.

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef unsigned int DelayType
 
enum  OperationType {
  SET_PRIORITY_LEVEL,
  SET_LEVEL_FOR_FLUSHING,
  ADD_LOG_OUTPUT,
  WRITE,
  FLUSH
}
 
typedef Logger::OutputType OutputType
 
typedef SmartPointer< SelfPointer
 
typedef Logger::PriorityLevelType PriorityLevelType
 
typedef ThreadLogger Self
 
typedef Logger Superclass
 
- Public Types inherited from itk::Logger
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Logger Self
 
typedef LoggerBase Superclass
 
- Public Types inherited from itk::LoggerBase
typedef SmartPointer< const SelfConstPointer
 
typedef
MultipleLogOutput::OutputType 
OutputType
 
typedef SmartPointer< SelfPointer
 
enum  PriorityLevelType {
  MUSTFLUSH = 0,
  FATAL,
  CRITICAL,
  WARNING,
  INFO,
  DEBUG,
  NOTSET
}
 
typedef LoggerBase Self
 
typedef Object Superclass
 
enum  TimeStampFormatType {
  REALVALUE = 0,
  HUMANREADABLE
}
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

virtual void AddLogOutput (OutputType *output) override
 
virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual void Flush () override
 
virtual DelayType GetDelay () const
 
virtual PriorityLevelType GetLevelForFlushing () const override
 
virtual const char * GetNameOfClass () const
 
virtual PriorityLevelType GetPriorityLevel () const override
 
virtual void SetDelay (DelayType delay)
 
virtual void SetLevelForFlushing (PriorityLevelType level) override
 
virtual void SetPriorityLevel (PriorityLevelType level) override
 
virtual void Write (PriorityLevelType level, std::string const &content) override
 
- Public Member Functions inherited from itk::LoggerBase
virtual std::string BuildFormattedEntry (PriorityLevelType level, std::string const &content)
 
void Critical (std::string const &message)
 
void Debug (std::string const &message)
 
void Error (std::string const &message)
 
void Fatal (std::string const &message)
 
virtual const char * GetName () const
 
void Info (std::string const &message)
 
virtual void SetName (const char *_arg)
 
void Warning (std::string const &message)
 
virtual void SetTimeStampFormat (TimeStampFormatType _arg)
 
virtual const TimeStampFormatTypeGetTimeStampFormat () const
 
virtual void SetHumanReadableFormat (const char *_arg)
 
virtual const char * GetHumanReadableFormat () const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::Logger
static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
 ThreadLogger ()
 
virtual ~ThreadLogger () override
 
- Protected Member Functions inherited from itk::Logger
 Logger ()
 
virtual ~Logger () override
 
- Protected Member Functions inherited from itk::LoggerBase
 LoggerBase ()
 
virtual ~LoggerBase () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Static Protected Member Functions

static ITK_THREAD_RETURN_TYPE ThreadFunction (void *)
 

Private Types

typedef std::queue
< PriorityLevelType
LevelContainerType
 
typedef std::queue< std::string > MessageContainerType
 
typedef std::queue< OperationTypeOperationContainerType
 
typedef std::queue
< OutputType::Pointer > 
OutputContainerType
 

Private Member Functions

void InternalFlush ()
 

Private Attributes

DelayType m_Delay
 
LevelContainerType m_LevelQ
 
MessageContainerType m_MessageQ
 
SimpleFastMutexLock m_Mutex
 
OperationContainerType m_OperationQ
 
OutputContainerType m_OutputQ
 
MultiThreader::Pointer m_Threader
 
ThreadIdType m_ThreadID
 

Additional Inherited Members

- Protected Attributes inherited from itk::LoggerBase
RealTimeClock::Pointer m_Clock
 
std::string m_HumanReadableFormat
 
PriorityLevelType m_LevelForFlushing
 
MultipleLogOutput::Pointer m_Output
 
PriorityLevelType m_PriorityLevel
 
TimeStampFormatType m_TimeStampFormat
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Member Typedef Documentation

Definition at line 47 of file itkThreadLogger.h.

typedef unsigned int itk::ThreadLogger::DelayType

Definition at line 59 of file itkThreadLogger.h.

Definition at line 124 of file itkThreadLogger.h.

typedef std::queue< std::string > itk::ThreadLogger::MessageContainerType
private

Definition at line 122 of file itkThreadLogger.h.

Definition at line 120 of file itkThreadLogger.h.

typedef std::queue< OutputType::Pointer > itk::ThreadLogger::OutputContainerType
private

Definition at line 126 of file itkThreadLogger.h.

typedef Logger::OutputType itk::ThreadLogger::OutputType

Definition at line 53 of file itkThreadLogger.h.

Definition at line 46 of file itkThreadLogger.h.

Definition at line 57 of file itkThreadLogger.h.

Definition at line 44 of file itkThreadLogger.h.

Definition at line 45 of file itkThreadLogger.h.

Member Enumeration Documentation

Definition of types of operations for ThreadLogger.

Enumerator
SET_PRIORITY_LEVEL 
SET_LEVEL_FOR_FLUSHING 
ADD_LOG_OUTPUT 
WRITE 
FLUSH 

Definition at line 62 of file itkThreadLogger.h.

Constructor & Destructor Documentation

itk::ThreadLogger::ThreadLogger ( )
protected

Constructor

virtual itk::ThreadLogger::~ThreadLogger ( )
overrideprotectedvirtual

Destructor

Member Function Documentation

virtual void itk::ThreadLogger::AddLogOutput ( OutputType output)
overridevirtual

Registers another output stream with the multiple output.

Reimplemented from itk::LoggerBase.

virtual::itk::LightObject::Pointer itk::ThreadLogger::CreateAnother ( ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::Logger.

virtual void itk::ThreadLogger::Flush ( )
overridevirtual

Reimplemented from itk::LoggerBase.

virtual DelayType itk::ThreadLogger::GetDelay ( ) const
virtual

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

virtual PriorityLevelType itk::ThreadLogger::GetLevelForFlushing ( ) const
overridevirtual

Reimplemented from itk::LoggerBase.

virtual const char* itk::ThreadLogger::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::Logger.

virtual PriorityLevelType itk::ThreadLogger::GetPriorityLevel ( ) const
overridevirtual

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.

Reimplemented from itk::LoggerBase.

void itk::ThreadLogger::InternalFlush ( )
private
static Pointer itk::ThreadLogger::New ( )
static

New macro for creation of a Smart Pointer

virtual void itk::ThreadLogger::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Print contents of a ThreadLogger

Reimplemented from itk::LoggerBase.

virtual void itk::ThreadLogger::SetDelay ( DelayType  delay)
virtual

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

virtual void itk::ThreadLogger::SetLevelForFlushing ( PriorityLevelType  level)
overridevirtual

Reimplemented from itk::LoggerBase.

virtual void itk::ThreadLogger::SetPriorityLevel ( PriorityLevelType  level)
overridevirtual

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.

Reimplemented from itk::LoggerBase.

static ITK_THREAD_RETURN_TYPE itk::ThreadLogger::ThreadFunction ( void *  )
staticprotected
virtual void itk::ThreadLogger::Write ( PriorityLevelType  level,
std::string const &  content 
)
overridevirtual

Reimplemented from itk::LoggerBase.

Member Data Documentation

DelayType itk::ThreadLogger::m_Delay
private

Definition at line 142 of file itkThreadLogger.h.

LevelContainerType itk::ThreadLogger::m_LevelQ
private

Definition at line 136 of file itkThreadLogger.h.

MessageContainerType itk::ThreadLogger::m_MessageQ
private

Definition at line 134 of file itkThreadLogger.h.

SimpleFastMutexLock itk::ThreadLogger::m_Mutex
private

Definition at line 140 of file itkThreadLogger.h.

OperationContainerType itk::ThreadLogger::m_OperationQ
private

Definition at line 132 of file itkThreadLogger.h.

OutputContainerType itk::ThreadLogger::m_OutputQ
private

Definition at line 138 of file itkThreadLogger.h.

MultiThreader::Pointer itk::ThreadLogger::m_Threader
private

Definition at line 128 of file itkThreadLogger.h.

ThreadIdType itk::ThreadLogger::m_ThreadID
private

Definition at line 130 of file itkThreadLogger.h.


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