00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "BaBar/BaBar.hh"
00010
00011 #include "CdbBdbShared/CdbBdbSCi.hh"
00012
00013 #include <iomanip>
00014 using std::ostream;
00015 using std::setfill;
00016 using std::setw;
00017
00018 CdbBdbSCi::CdbBdbSCi( const BdbTime& theBeginTime,
00019 const BdbTime& theEndTime ) :
00020 isEmpty (true),
00021 begin (theBeginTime),
00022 end (theEndTime)
00023 { }
00024
00025 CdbBdbSCi::CdbBdbSCi( const BdbTime& theBeginTime,
00026 const BdbTime& theEndTime,
00027 const CdbBdbSOi& theOriginalInterval ) :
00028 isEmpty (false),
00029 begin (theBeginTime),
00030 end (theEndTime),
00031 original(theOriginalInterval)
00032 { }
00033
00034 CdbBdbSCi::CdbBdbSCi( const CdbBdbSCi& theInterval ) :
00035 isEmpty (theInterval.isEmpty),
00036 begin (theInterval.begin),
00037 end (theInterval.end),
00038 original(theInterval.original)
00039 { }
00040
00041 CdbBdbSCi::~CdbBdbSCi( ) { }
00042
00043 CdbBdbSCi&
00044 CdbBdbSCi::operator=( const CdbBdbSCi& theInterval )
00045 {
00046 if( this != &theInterval ) {
00047 isEmpty = theInterval.isEmpty;
00048 begin = theInterval.begin;
00049 end = theInterval.end;
00050 original = theInterval.original;
00051 }
00052 return *this;
00053 }
00054
00055 void
00056 CdbBdbSCi::dump( ostream& o ) const
00057 {
00058
00059
00060 d_ULong vBeginSec = begin.getGmtSec( );
00061 d_ULong vBeginNsec = begin.getGmtNsec( );
00062 d_ULong vEndSec = end.getGmtSec( );
00063 d_ULong vEndNsec = end.getGmtNsec( );
00064
00065 o << " [ "
00066 << setw( 10 ) << setfill( '0' ) << vBeginSec
00067 << "."
00068 << setw( 10 ) << setfill( '0' ) << vBeginNsec
00069 << " , "
00070 << setw( 10 ) << setfill( '0' ) << vEndSec
00071 << "."
00072 << setw( 10 ) << setfill( '0' ) << vEndNsec
00073 << " ) ";
00074
00075 if( !isEmpty ) {
00076
00077
00078
00079 d_ULong oBeginSec = original.begin.getGmtSec( );
00080 d_ULong oBeginNsec = original.begin.getGmtNsec( );
00081 d_ULong oEndSec = original.end.getGmtSec( );
00082 d_ULong oEndNsec = original.end.getGmtNsec( );
00083
00084 o << " [ "
00085 << setw( 10 ) << setfill( '0' ) << oBeginSec
00086 << "."
00087 << setw( 10 ) << setfill( '0' ) << oBeginNsec
00088 << " , "
00089 << setw( 10 ) << setfill( '0' ) << oEndSec
00090 << "."
00091 << setw( 10 ) << setfill( '0' ) << oEndNsec
00092 << " ) ";
00093
00094
00095
00096 d_ULong oInsertedSec = original.inserted.getGmtSec( );
00097 d_ULong oInsertedNsec = original.inserted.getGmtNsec( );
00098
00099 o << " "
00100 << setw( 10 ) << setfill( '0' ) << oInsertedSec
00101 << "."
00102 << setw( 10 ) << setfill( '0' ) << oInsertedNsec
00103 << " ";
00104
00105
00106
00107 o << " "
00108 << original.object.sprint( )
00109 << " ";
00110 }
00111 }
00112
00113
00114
00115