Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkThreadSafeLog.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkThreadSafeLog.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00033 #ifndef __vtkThreadSafeLog_h
00034 #define __vtkThreadSafeLog_h
00035 
00036 #include "vtkObject.h"
00037 
00038 
00039 #define VTK_THREAD_SAFE_LOG_MAX 1000
00040 
00041 class VTK_PARALLEL_EXPORT vtkThreadSafeLog : public vtkObject
00042 {
00043 public:
00044   static vtkThreadSafeLog *New();
00045   vtkTypeRevisionMacro(vtkThreadSafeLog, vtkObject);
00046   virtual void PrintSelf(ostream& os, vtkIndent indent);
00047 
00049 
00050   void StartTimer();
00051   void StopTimer();
00052   double GetElapsedTime();
00054 
00056   void AddEntry(char *tag, float value);
00057 
00059 
00062   void DumpLog(char *filename, int mode);
00063   void DumpLog(char *filename);
00065 
00066 protected:
00067 
00068   vtkThreadSafeLog(); //insure constructur/destructor protected
00069   ~vtkThreadSafeLog();
00070 
00071 
00072   char *Tags[VTK_THREAD_SAFE_LOG_MAX];
00073   float Values[VTK_THREAD_SAFE_LOG_MAX];
00074   int NumberOfEntries;
00075 
00076   vtkTimerLog *Timer;
00077 private:
00078   vtkThreadSafeLog(const vtkThreadSafeLog&);  // Not implemented.
00079   void operator=(const vtkThreadSafeLog&);  // Not implemented.
00080 };
00081 
00082 
00083 
00084 #endif