Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ITime.h

Go to the documentation of this file.
00001 #ifndef        __GAUDI_INTERFACES_ITIME_H__
00002 #define        __GAUDI_INTERFACES_ITIME_H__
00003 
00004 #include <iostream> 
00005 #include "GaudiKernel/Kernel.h"
00006 
00007 //
00008 //   Class ITime:  a crude interface to any time-stamps
00009 //                 provide minimal interface for stamp 
00010 //                 manipulation with "time" object. 
00011 //        
00012 //                 One should distinguish the notion of
00013 //                 time-stamp and time-difference.
00014 //                 e.g. unit of "month" is good for 
00015 //                 "time-stamp" and it is unacceptable for 
00016 //                 "time-difference, since the month can 
00017 //                 consists of 30 or 31 day. The same argument
00018 //                 is applied to "year"
00019 //                 Another difference is from teh notion of "0"-year
00020 // 
00021 //                 This interface is common for "time-stamp"
00022 //                 and "time-difference"
00023 //                 
00024 
00025 
00026 class ITime
00027 {
00028 public:  
00029   //
00030   // internal representation
00031   // (probably in ns units - according to CLHEP/Units/SystemOfUnits.h
00032   // if it is so 1 year == (approx) (10**9) * (3*10**7) = 3*10^16 "units"
00033   //
00034   // representation in given units
00035   typedef longlong       AbsoluteTime;
00036   typedef double         DimensionedTime;
00037 
00038 
00039   
00040  public: 
00041   
00042   //
00043   // accessor to internal representation 
00044   virtual       AbsoluteTime      absoluteTime  () const = 0; 
00045   
00046   // accessor to representation in seconds 
00047   virtual       DimensionedTime   seconds       () const = 0;      
00048 
00049   // accessor to representation in minutes 
00050   virtual       DimensionedTime   minutes       () const = 0;      
00051 
00052   // accessor to representation in hours
00053   virtual       DimensionedTime   hours         () const = 0; 
00054 
00055   // accessor to representation in days 
00056   virtual       DimensionedTime   days          () const = 0;
00057   
00058   
00059   // comparison operators
00060   virtual       bool              operator==( const ITime& ) const = 0;
00061   virtual       bool              operator!=( const ITime& ) const = 0;
00062   virtual       bool              operator<=( const ITime& ) const = 0;    
00063   virtual       bool              operator>=( const ITime& ) const = 0;
00064   virtual       bool              operator< ( const ITime& ) const = 0;    
00065   virtual       bool              operator> ( const ITime& ) const = 0;
00066   
00067   // adding   
00068   virtual       ITime&            operator+=( const ITime& ) = 0 ; 
00069   
00070   // substraction
00071   virtual       ITime&            operator-=( const ITime& ) = 0 ; 
00072   
00073   virtual std::ostream&  printOut( std::ostream& ) const = 0;  
00074 
00075   // destructor 
00076   virtual ~ITime(){};
00077 
00078 };
00079 
00080 //
00081 //
00082 //
00083 
00084 inline std::ostream& operator<<(std::ostream& os , const ITime& time ) 
00085 { return  time.printOut(os); } 
00086 
00087 //
00088 //
00089 //
00090 
00091 #endif   //    __GAUDI_INTERFACES_ITIME_H__

Generated at Wed Nov 21 12:22:04 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000