IGSTK
igstkFLTKTextBufferLogOutput.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkFLTKTextBufferLogOutput.h,v $
5  Language: C++
6  Date: $Date: 2008-02-11 01:41:50 $
7  Version: $Revision: 1.9 $
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 __igstkFLTKTextBufferLogOutput_h
19 #define __igstkFLTKTextBufferLogOutput_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 
31 #include "igstkMacros.h"
32 #include "igstkStateMachine.h"
33 
34 
35 namespace igstk
36 {
37 
45 class FLTKTextBufferLogOutput : public ::itk::LogOutput
46 {
47 
48 public:
49 
52 
53 
55 
56 
57 public:
58 
59  typedef Fl_Text_Buffer StreamType;
61 
64 
66  void SetStream(StreamType &Stream);
67 
69  virtual void Flush();
70 
72  virtual void Write(double timestamp);
73 
75  virtual void Write(std::string const &content);
76 
78  virtual void Write(std::string const &content, double timestamp);
79 
80 protected:
83 
85  virtual ~FLTKTextBufferLogOutput();
86 
88  virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
89 
90 private:
91 
93  StreamPointerType m_Stream;
94 
96  itk::SimpleFastMutexLock m_Mutex;
97 };
98 
99 } // end namespace igstk
100 
101 #endif //__igstk_FLTKTextBufferLogOutput_h_
virtual void Flush()
Flush a buffer.
#define igstkGetMacro(name, type)
Get built-in type.
Definition: igstkMacros.h:105
#define igstkStandardClassTraitsMacro(classname, superclassname)
Convenience macro for traits of a non-templated class.
Definition: igstkMacros.h:275
defines standard system-wide macros, constants, and other common parameters in the IGSTK Library...
virtual void Write(double timestamp)
Write to multiple outputs.
void SetStream(StreamType &Stream)
Set an output stream pointer.
#define igstkLoggerMacro()
Macro that defines all the standard elements related to the Logger.
Definition: igstkMacros.h:143
Class FLTKTextBufferLogOutput represents a standard output stream.
virtual ~FLTKTextBufferLogOutput()
Destructor.
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const
Print object information.
FLTKTextBufferLogOutput()
Constructor.