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

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 =========================================================================*/
00037 #ifndef __vtkThreadSafeLog_h
00038 #define __vtkThreadSafeLog_h
00039 
00040 #include "vtkObject.h"
00041 
00042 #define VTK_THREAD_SAFE_LOG_MAX 1000
00043 
00044 class VTK_PARALLEL_EXPORT vtkThreadSafeLog : public vtkObject
00045 {
00046 public:
00047   static vtkThreadSafeLog *New();
00048   vtkTypeRevisionMacro(vtkThreadSafeLog, vtkObject);
00049   virtual void PrintSelf(ostream& os, vtkIndent indent);
00050 
00052 
00053   void StartTimer() { this->Timer->StartTimer();}
00054   void StopTimer() { this->Timer->StopTimer();}
00055   double GetElapsedTime() { return this->Timer->GetElapsedTime();}
00057 
00059   void AddEntry(char *tag, float value);
00060 
00064   void DumpLog(char *filename, int mode = ios::out);
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