ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
00001 /*========================================================================= 00002 * 00003 * Copyright Insight Software Consortium 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0.txt 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 * 00017 *=========================================================================*/ 00018 #ifndef __itkRealTimeStamp_h 00019 #define __itkRealTimeStamp_h 00020 00021 #include "itkRealTimeInterval.h" 00022 #include "itkMacro.h" 00023 #include <iostream> 00024 00025 namespace itk 00026 { 00045 class ITKCommon_EXPORT RealTimeStamp 00046 { 00047 public: 00048 00049 typedef RealTimeStamp Self; 00050 00051 friend class RealTimeClock; 00052 00054 RealTimeStamp(); 00055 00057 ~RealTimeStamp(); 00058 00060 typedef RealTimeInterval::TimeRepresentationType TimeRepresentationType; 00061 00063 TimeRepresentationType GetTimeInMicroSeconds() const; 00064 TimeRepresentationType GetTimeInMilliSeconds() const; 00065 TimeRepresentationType GetTimeInSeconds() const; 00066 TimeRepresentationType GetTimeInMinutes() const; 00067 TimeRepresentationType GetTimeInHours() const; 00068 TimeRepresentationType GetTimeInDays() const; 00070 00072 RealTimeInterval operator-( const Self & ) const; 00073 Self operator+( const RealTimeInterval & ) const; 00074 Self operator-( const RealTimeInterval & ) const; 00075 const Self & operator+=( const RealTimeInterval & ); 00076 const Self & operator-=( const RealTimeInterval & ); 00078 00080 bool operator>( const Self & ) const; 00081 bool operator<( const Self & ) const; 00082 bool operator==( const Self & ) const; 00083 bool operator!=( const Self & ) const; 00084 bool operator<=( const Self & ) const; 00085 bool operator>=( const Self & ) const; 00087 00089 friend ITKCommon_EXPORT std::ostream & operator<<(std::ostream & os, const RealTimeStamp & v); 00090 00091 private: 00092 00093 typedef uint64_t SecondsCounterType; 00094 typedef uint64_t MicroSecondsCounterType; 00095 00097 RealTimeStamp( SecondsCounterType, MicroSecondsCounterType ); 00098 00099 typedef RealTimeInterval::SecondsDifferenceType SecondsDifferenceType; 00100 typedef RealTimeInterval::MicroSecondsDifferenceType MicroSecondsDifferenceType; 00101 00103 SecondsCounterType m_Seconds; 00104 MicroSecondsCounterType m_MicroSeconds; 00105 00106 }; 00107 00108 } // end of namespace itk 00109 00110 #endif // __itkRealTimeStamp_h 00111