| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkRealTimeClock.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:46 $ |
| 7 |
|
Version: $Revision: 1.4 $ |
| 8 |
|
|
| 9 |
|
Copyright (c) Insight Software Consortium. All rights reserved. |
| 10 |
|
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. |
| 11 |
|
|
| 12 |
|
This software is distributed WITHOUT ANY WARRANTY; without even |
| 13 |
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 |
|
PURPOSE. See the above copyright notices for more information. |
| 15 |
|
|
| 16 |
|
=========================================================================*/ |
| 17 |
|
|
| 18 |
|
#ifndef __itkRealTimeClock_h |
| 19 |
|
#define __itkRealTimeClock_h |
| 20 |
|
|
| 21 |
|
#include <itkMacro.h> |
| 22 |
|
#include <itkObject.h> |
| 23 |
|
#include <itkObjectFactory.h> |
| 24 |
|
|
| 25 |
|
namespace itk |
| 26 |
|
{ |
| 27 |
|
|
| 28 |
|
/** \class RealTimeClock |
| 29 |
IND |
* \brief The RealTimeClock provides a timestamp from a real-time clock |
| 30 |
IND |
* |
| 31 |
IND |
* This class represents a real-time clock object |
| 32 |
IND |
* and provides a timestamp in platform-independent format. |
| 33 |
IND |
* |
| 34 |
IND |
* \author Hee-Su Kim, Compute Science Dept. Kyungpook National University, |
| 35 |
IND |
* ISIS Center, Georgetown University. |
| 36 |
IND |
*/ |
| 37 |
|
|
| 38 |
|
class ITKCommon_EXPORT RealTimeClock : public itk::Object |
| 39 |
|
{ |
| 40 |
|
|
| 41 |
|
public: |
| 42 |
|
|
| 43 |
|
typedef RealTimeClock Self; |
| 44 |
TDA |
typedef itk::Object Superclass; |
| 45 |
TDA |
typedef itk::SmartPointer< Self > Pointer; |
| 46 |
TDA |
typedef itk::SmartPointer< const Self > ConstPointer; |
| 47 |
|
|
| 48 |
|
/** Method for defining the name of the class */ |
| 49 |
|
itkTypeMacro(RealTimeClock, Object); |
| 50 |
|
|
| 51 |
|
/** Method for creation through the object factory */ |
| 52 |
|
itkNewMacro(Self); |
| 53 |
|
|
| 54 |
|
/** Define the type for the timestap */ |
| 55 |
|
typedef double TimeStampType; |
| 56 |
|
|
| 57 |
|
/** Define the type for the frequency of the clock */ |
| 58 |
|
typedef double FrequencyType; |
| 59 |
|
|
| 60 |
|
/** Returns a timestamp in seconds e.g. 52.341243 seconds */ |
| 61 |
|
TimeStampType GetTimeStamp() const; |
| 62 |
|
TimeStampType GetTimestamp() const |
| 63 |
|
{ |
| 64 |
|
itkWarningMacro("This call is deprecated. " |
| 65 |
|
"Its namimg was not conforming to ITK Style. " |
| 66 |
|
"Please use GetTimeStamp() instead. Note the capital S"); |
| 67 |
|
return this->GetTimeStamp(); |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
/** Returns the frequency of a clock */ |
| 71 |
|
itkGetConstMacro(Frequency, FrequencyType); |
| 72 |
|
|
| 73 |
|
protected: |
| 74 |
|
|
| 75 |
|
/** constructor */ |
| 76 |
|
RealTimeClock(); |
| 77 |
|
|
| 78 |
|
/** destructor */ |
| 79 |
|
virtual ~RealTimeClock(); |
| 80 |
|
|
| 81 |
|
/** Print the object information in a stream. */ |
| 82 |
|
virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const; |
| 83 |
|
|
| 84 |
|
private: |
| 85 |
|
|
| 86 |
|
FrequencyType m_Frequency; |
| 87 |
|
|
| 88 |
|
TimeStampType m_Difference; |
| 89 |
|
|
| 90 |
|
TimeStampType m_Origin; |
| 91 |
|
|
| 92 |
|
}; |
| 93 |
|
|
| 94 |
|
} // end of namespace itk |
| 95 |
|
|
| 96 |
|
|
| 97 |
|
#endif // __itkRealTimeClock_h |
| 98 |
|
|