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

dox/Parallel/vtkThreadSafeLog.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkThreadSafeLog.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00025 #ifndef __vtkThreadSafeLog_h
00026 #define __vtkThreadSafeLog_h
00027 
00028 #include "vtkObject.h"
00029 
00030 #define VTK_THREAD_SAFE_LOG_MAX 1000
00031 
00032 class VTK_PARALLEL_EXPORT vtkThreadSafeLog : public vtkObject
00033 {
00034 public:
00035   static vtkThreadSafeLog *New();
00036   vtkTypeRevisionMacro(vtkThreadSafeLog, vtkObject);
00037   virtual void PrintSelf(ostream& os, vtkIndent indent);
00038 
00040 
00041   void StartTimer() { this->Timer->StartTimer();}
00042   void StopTimer() { this->Timer->StopTimer();}
00043   double GetElapsedTime() { return this->Timer->GetElapsedTime();}
00045 
00047   void AddEntry(char *tag, float value);
00048 
00052   void DumpLog(char *filename, int mode = ios::out);
00053 
00054 protected:
00055 
00056   vtkThreadSafeLog(); //insure constructur/destructor protected
00057   ~vtkThreadSafeLog();
00058 
00059 
00060   char *Tags[VTK_THREAD_SAFE_LOG_MAX];
00061   float Values[VTK_THREAD_SAFE_LOG_MAX];
00062   int NumberOfEntries;
00063 
00064   vtkTimerLog *Timer;
00065 private:
00066   vtkThreadSafeLog(const vtkThreadSafeLog&);  // Not implemented.
00067   void operator=(const vtkThreadSafeLog&);  // Not implemented.
00068 };
00069 
00070 
00071 
00072 #endif