00001 #ifndef DataFormats_Provenance_Timestamp_h 00002 #define DataFormats_Provenance_Timestamp_h 00003 // -*- C++ -*- 00004 // 00005 // Package: DataFormats/Provenance 00006 // Class: Timestamp 00007 // 00016 // 00017 // Author: Chris Jones 00018 // Created: Thu Mar 24 16:23:05 EST 2005 00019 // 00020 00021 // system include files 00022 00023 // user include files 00024 00025 // forward declarations 00026 namespace edm { 00027 typedef unsigned long long TimeValue_t; 00028 00029 class Timestamp 00030 { 00031 00032 public: 00033 Timestamp(TimeValue_t iValue) ; 00034 Timestamp(); 00035 00036 virtual ~Timestamp(); 00037 00038 TimeValue_t value() const; 00039 00040 // ---------- const member functions --------------------- 00041 bool operator==(const Timestamp& iRHS) const { 00042 return timeHigh_ == iRHS.timeHigh_ && 00043 timeLow_ == iRHS.timeLow_; 00044 } 00045 bool operator!=(const Timestamp& iRHS) const { 00046 return !(*this == iRHS); 00047 } 00048 00049 bool operator<(const Timestamp& iRHS) const { 00050 if(timeHigh_ == iRHS.timeHigh_) { 00051 return timeLow_ < iRHS.timeLow_; 00052 } 00053 return timeHigh_ < iRHS.timeHigh_; 00054 } 00055 bool operator<=(const Timestamp& iRHS) const { 00056 if(timeHigh_ == iRHS.timeHigh_) { 00057 return timeLow_ <= iRHS.timeLow_; 00058 } 00059 return timeHigh_ <= iRHS.timeHigh_; 00060 } 00061 bool operator>(const Timestamp& iRHS) const { 00062 if(timeHigh_ == iRHS.timeHigh_) { 00063 return timeLow_ > iRHS.timeLow_; 00064 } 00065 return timeHigh_ > iRHS.timeHigh_; 00066 } 00067 bool operator>=(const Timestamp& iRHS) const { 00068 if(timeHigh_ == iRHS.timeHigh_) { 00069 return timeLow_ >= iRHS.timeLow_; 00070 } 00071 return timeHigh_ >= iRHS.timeHigh_; 00072 } 00073 00074 // ---------- static member functions -------------------- 00075 static const Timestamp& invalidTimestamp(); 00076 static const Timestamp& endOfTime(); 00077 static const Timestamp& beginOfTime(); 00078 00079 // ---------- member functions --------------------------- 00080 00081 private: 00082 //Timestamp(const Timestamp&); // allow default 00083 00084 //const Timestamp& operator=(const Timestamp&); // allow default 00085 00086 // ---------- member data -------------------------------- 00087 // ROOT does not support ULL 00088 //TimeValue_t time_; 00089 unsigned int timeLow_; 00090 unsigned int timeHigh_; 00091 }; 00092 00093 } 00094 #endif