00001 #ifndef CDBBDBSHARED_OI_HH
00002 #define CDBBDBSHARED_OI_HH
00003
00004
00005
00006
00007 #include "BdbUtil/Bdb.hh"
00008
00009 #include "CdbBase/CdbCommon.hh"
00010
00011 #include "BdbTime/BdbTime.hh"
00012 #include "BdbCond/BdbObject.hh"
00013
00014 #include <iostream>
00015
00016
00017
00018
00019
00020
00021
00022
00023 class CdbBdbSOi {
00024
00025 public:
00026
00027
00028
00029
00030 CdbBdbSOi( ) :
00031 begin (BdbTime::minusInfinity),
00032 end (BdbTime::minusInfinity),
00033 inserted(BdbTime::minusInfinity),
00034 object (0)
00035 { }
00036
00037
00038
00039
00040 CdbBdbSOi( const BdbTime& theBeginTime,
00041 const BdbTime& theEndTime,
00042 const BdbTime& theInsertionTime,
00043 const BdbRef(BdbObject)& theObjectRef ) :
00044 begin (theBeginTime),
00045 end (theEndTime),
00046 inserted(theInsertionTime),
00047 object (theObjectRef)
00048 { }
00049
00050
00051
00052
00053 CdbBdbSOi( const CdbBdbSOi& theInterval ) :
00054 begin (theInterval.begin),
00055 end (theInterval.end),
00056 inserted(theInterval.inserted),
00057 object (theInterval.object)
00058 { }
00059
00060
00061
00062
00063
00064
00065 ~CdbBdbSOi( ) { }
00066
00067
00068
00069
00070 CdbBdbSOi& operator=( const CdbBdbSOi& theInterval )
00071 {
00072 if( this != &theInterval ) {
00073 begin = theInterval.begin;
00074 end = theInterval.end;
00075 inserted = theInterval.inserted;
00076 object = theInterval.object;
00077 }
00078 return *this;
00079 }
00080
00081 public:
00082
00083 BdbTime begin;
00084 BdbTime end;
00085
00086 BdbTime inserted;
00087
00088 BdbRef(BdbObject) object;
00089 };
00090
00091 inline
00092 std::ostream&
00093 operator<<( std::ostream& o,
00094 const CdbBdbSOi& theInterval )
00095 {
00096 o << "[ " << theInterval.begin.getGmtSec( ) << "." << theInterval.begin.getGmtNsec( ) << " , "
00097 << theInterval.end.getGmtSec( ) << "." << theInterval.end.getGmtNsec( ) << " ) -> "
00098 << theInterval.object.sprint( ) << " : "
00099 << theInterval.inserted.getGmtSec( ) << "." << theInterval.inserted.getGmtNsec( ) << std::endl;
00100 return o;
00101 }
00102
00103 #endif // CDBBDBSHARED_OI_HH