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

vtkExtensionsGregorianClock.h

Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 00002 * 00003 * $Id: vtkExtensionsGregorianClock.h,v 1.3 2004/08/10 07:37:21 xpxqx Exp $ 00004 * 00005 * Copyright (c) 2004 Sean McInerney 00006 * All rights reserved. 00007 * 00008 * See Copyright.txt or http://vtkextensions.sourceforge.net/Copyright.html 00009 * 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 */ 00016 #ifndef VTK_EXTENSIONS_GREGORIAN_CLOCK_H_ 00017 # define VTK_EXTENSIONS_GREGORIAN_CLOCK_H_ 00018 # include "vtkExtensionsCommonConfigure.h" // vtkExtensions configuration 00019 # include "vtkExtensionsTypes.h" // vtkExtensions types 00020 // VTK Common 00021 # include "vtkCriticalSection.h" // member 00022 # include "vtkObject.h" 00023 00024 VTK_EXTENSIONS_NAMESPACE_BEGIN 00025 00026 class vtkExtensionsRNG; 00027 00041 class VTK_EXTENSIONS_COMMON_EXPORT vtkExtensionsGregorianClock 00042 : public vtkObject 00043 { 00044 public: 00045 static vtkExtensionsGregorianClock* New (void); 00046 vtkTypeRevisionMacro (vtkExtensionsGregorianClock, vtkObject); 00047 void PrintSelf (ostream&, vtkIndent); 00048 00050 void GetClock (vtkUint32Type& clockHigh, 00051 vtkUint32Type& clockLow, 00052 vtkUint16Type& resultClockSeq); 00053 00054 //BTX 00057 static const vtkUint32Type TimeOffsetLow = VTK_EXTENSIONS_UINT32(0x13814000); 00058 static const vtkUint32Type TimeOffsetHigh= VTK_EXTENSIONS_UINT32(0x01B21DD2); 00060 //ETX 00061 00062 void SetRNG (vtkExtensionsRNG*); 00063 vtkGetObjectMacro(RNG, vtkExtensionsRNG); 00064 00065 protected: 00066 vtkExtensionsGregorianClock (void); 00067 ~vtkExtensionsGregorianClock(); 00068 00069 private: 00070 //BTX 00071 // Assume that the gettimeofday() has microsecond granularity. 00072 static const vtkInt32Type MaxAdjustment = VTK_EXTENSIONS_INT32(10); 00073 00074 // Syncronization primatives. 00075 vtkSimpleCriticalSection CriticalSection; 00076 00077 // Clock. 00078 vtkInt32Type Adjustment; 00079 long LastSeconds; 00080 long LastMicroseconds; 00081 vtkUint16Type ClockSeq; 00082 00083 vtkExtensionsRNG* RNG; 00084 //ETX 00085 00086 private: 00092 vtkExtensionsGregorianClock (const vtkExtensionsGregorianClock&); 00093 void operator= (const vtkExtensionsGregorianClock&); 00095 }; 00096 00097 VTK_EXTENSIONS_NAMESPACE_END 00098 00099 #endif /* VTK_EXTENSIONS_GREGORIAN_CLOCK_H_ */ 00100 /* 00101 * End of: $Id: vtkExtensionsGregorianClock.h,v 1.3 2004/08/10 07:37:21 xpxqx Exp $. 00102 * 00103 */

Generated on Tue Aug 10 03:37:11 2004 for vtkExtensions by doxygen 1.3.7