00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkStdStreamLogOutput_h
00019 #define __itkStdStreamLogOutput_h
00020
00021 #include <iostream>
00022 #include <string>
00023
00024 #include "itkMacro.h"
00025 #include "itkObject.h"
00026 #include "itkObjectFactory.h"
00027 #include "itkSimpleFastMutexLock.h"
00028 #include "itkLogOutput.h"
00029
00030
00031 namespace itk
00032 {
00033
00045 class ITKCommon_EXPORT StdStreamLogOutput : public LogOutput
00046 {
00047
00048 public:
00049
00050 typedef StdStreamLogOutput Self;
00051 typedef LogOutput Superclass;
00052 typedef SmartPointer<Self> Pointer;
00053 typedef SmartPointer<const Self> ConstPointer;
00054
00055 typedef std::ostream StreamType;
00056 typedef std::ostream* StreamPointerType;
00057
00058 itkTypeMacro(StdStreamLogOutput, LogOutput);
00059
00060 itkNewMacro(StdStreamLogOutput);
00061
00062 itkGetMacro(Stream, StreamPointerType);
00063
00065 void SetStream(StreamType &Stream);
00066
00068 virtual void Flush();
00069
00071 virtual void Write(double timestamp);
00072
00074 virtual void Write(std::string const &content);
00075
00077 virtual void Write(std::string const &content, double timestamp);
00078
00079 protected:
00081 StdStreamLogOutput();
00082
00084 virtual ~StdStreamLogOutput();
00085
00086 void PrintSelf(std::ostream &os, Indent indent) const;
00087
00088 private:
00089
00090 StreamPointerType m_Stream;
00091
00092 SimpleFastMutexLock m_Mutex;
00093 };
00094
00095 }
00096
00097 #endif //__itkStdStreamLogOutput_h
00098