00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __igstkFLTKTextBufferLogOutput_h
00019 #define __igstkFLTKTextBufferLogOutput_h
00020
00021 #include <iostream>
00022 #include <string>
00023
00024 #include "itkObject.h"
00025 #include "itkObjectFactory.h"
00026 #include "itkSimpleFastMutexLock.h"
00027 #include "itkLogOutput.h"
00028
00029 #include <FL/Fl_Text_Buffer.H>
00030
00031 #include "igstkMacros.h"
00032 #include "igstkStateMachine.h"
00033
00034
00035 namespace igstk
00036 {
00037
00045 class FLTKTextBufferLogOutput : public ::itk::LogOutput
00046 {
00047
00048 public:
00049
00051 igstkStandardClassTraitsMacro( FLTKTextBufferLogOutput, ::itk::LogOutput )
00052
00053
00054 igstkLoggerMacro()
00055
00056
00057 public:
00058
00059 typedef Fl_Text_Buffer StreamType;
00060 typedef StreamType* StreamPointerType;
00061
00063 igstkGetMacro(Stream, StreamPointerType);
00064
00066 void SetStream(StreamType &Stream);
00067
00069 virtual void Flush();
00070
00072 virtual void Write(double timestamp);
00073
00075 virtual void Write(std::string const &content);
00076
00078 virtual void Write(std::string const &content, double timestamp);
00079
00080 protected:
00082 FLTKTextBufferLogOutput();
00083
00085 virtual ~FLTKTextBufferLogOutput();
00086
00088 virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
00089
00090 private:
00091
00093 StreamPointerType m_Stream;
00094
00096 itk::SimpleFastMutexLock m_Mutex;
00097 };
00098
00099 }
00100
00101 #endif //__igstk_FLTKTextBufferLogOutput_h_