ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkRealTimeClock.h
Go to the documentation of this file.
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 __itkRealTimeClock_h
00019 #define __itkRealTimeClock_h
00020 
00021 #include "itkMacro.h"
00022 #include "itkObject.h"
00023 #include "itkObjectFactory.h"
00024 #include "itkRealTimeStamp.h"
00025 
00026 namespace itk
00027 {
00039 class ITKCommon_EXPORT RealTimeClock:public Object
00040 {
00041 public:
00042   typedef RealTimeClock              Self;
00043   typedef Object                     Superclass;
00044   typedef SmartPointer< Self >       Pointer;
00045   typedef SmartPointer< const Self > ConstPointer;
00046 
00048   itkTypeMacro(RealTimeClock, Object);
00049 
00051   itkNewMacro(Self);
00052 
00054   typedef double TimeStampType;
00055 
00057   typedef double FrequencyType;
00058 
00060   TimeStampType GetTimeInSeconds() const;
00061 
00063   itkGetConstMacro(Frequency, FrequencyType);
00064 
00066   RealTimeStamp GetRealTimeStamp() const;
00067 
00068 protected:
00069 
00071   RealTimeClock();
00072 
00074   virtual ~RealTimeClock();
00075 
00077   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00078 
00079 private:
00080   FrequencyType m_Frequency;
00081   TimeStampType m_Difference;
00082   TimeStampType m_Origin;
00083 
00084   // We hide this method in the private section, because it returns the
00085   // modified time of the itk::Object.  That modified time is ambiguous with
00086   // the role of the RealTimeStamp.
00087   virtual const TimeStamp & GetTimeStamp() const;
00088 };
00089 } // end of namespace itk
00090 
00091 #endif  // __itkRealTimeClock_h
00092