IGSTK
igstkFLTKTextLogOutput.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkFLTKTextLogOutput.h,v $
5  Language: C++
6  Date: $Date: 2008-02-11 01:41:50 $
7  Version: $Revision: 1.8 $
8 
9  Copyright (c) ISC Insight Software Consortium. All rights reserved.
10  See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef __igstkFLTKTextLogOutput_h
19 #define __igstkFLTKTextLogOutput_h
20 
21 #include <iostream>
22 #include <string>
23 
24 #include "itkObject.h"
25 #include "itkObjectFactory.h"
26 #include "itkSimpleFastMutexLock.h"
27 #include "itkLogOutput.h"
28 
29 #include <FL/Fl_Text_Buffer.H>
30 #include <FL/Fl_Text_Display.H>
31 
32 #include "igstkMacros.h"
33 #include "igstkStateMachine.h"
34 
35 
36 namespace igstk
37 {
38 
47 class FLTKTextLogOutput : public ::itk::LogOutput
48 {
49 
50 public:
51 
54 
55 public:
56 
57  typedef Fl_Text_Display StreamType;
58  typedef StreamType* StreamPointerType;
59 
61  igstkGetMacro(Stream, StreamPointerType);
62 
64  void SetStream(StreamType &Stream);
65 
67  virtual void Flush();
68 
70  virtual void Write(double timestamp);
71 
73  virtual void Write(std::string const &content);
74 
76  virtual void Write(std::string const &content, double timestamp);
77 
78 protected:
81 
83  virtual ~FLTKTextLogOutput();
84 
86  virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
87 
88 private:
89 
91  StreamPointerType m_Stream;
92 
94  itk::SimpleFastMutexLock m_Mutex;
95 };
96 
97 } // end namespace igstk
98 
99 #endif //__igstk_FLTKTextLogOutput_h_