00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "BaBar/BaBar.hh"
00010
00011 #include "CdbBdbShared/CdbBdbSSimpleConfigIterator.hh"
00012
00013 CdbBdbSSimpleConfigIterator::CdbBdbSSimpleConfigIterator( const CdbBdbSSimpleConfigIterator& theItr ) :
00014 _isValid (theItr._isValid),
00015 _hasEverBeenAdvanced(theItr._hasEverBeenAdvanced),
00016 _value (theItr._value)
00017 { }
00018
00019 CdbBdbSSimpleConfigIterator::CdbBdbSSimpleConfigIterator( const CdbBdbSConfigElement& theConfigElement,
00020 const BdbTime& theBeginTime,
00021 const BdbTime& theEndTime ) :
00022 _isValid (false),
00023 _hasEverBeenAdvanced (false),
00024 _value(CdbBdbSConfigInterval( theConfigElement,
00025 theBeginTime,
00026 theEndTime ))
00027 { }
00028
00029 CdbBdbSSimpleConfigIterator::CdbBdbSSimpleConfigIterator( const CdbBdbSConfigInterval& theConfigInterval ) :
00030 _isValid (false),
00031 _hasEverBeenAdvanced (false),
00032 _value(theConfigInterval)
00033 { }
00034
00035 CdbBdbSSimpleConfigIterator::~CdbBdbSSimpleConfigIterator( )
00036 { }
00037
00038 CdbStatus
00039 CdbBdbSSimpleConfigIterator::reset( )
00040 {
00041 _isValid = false;
00042 _hasEverBeenAdvanced = false;
00043
00044 return CdbStatus::Success;
00045 }
00046
00047 bool
00048 CdbBdbSSimpleConfigIterator::next( )
00049 {
00050 if( _isValid ) {
00051
00052
00053
00054 _isValid = false;
00055
00056 } else {
00057
00058 if( !_hasEverBeenAdvanced ) {
00059
00060 _isValid = true;
00061 _hasEverBeenAdvanced = true;
00062
00063 } else {
00064
00065
00066
00067
00068 ;
00069 }
00070 }
00071 return _isValid;
00072 }
00073
00074 CdbBdbSSimpleConfigIterator::ValueType
00075 CdbBdbSSimpleConfigIterator::value( )
00076 {
00077 if( _isValid ) {
00078 return _value;
00079 }
00080
00081
00082
00083 return CdbBdbSConfigInterval( );
00084 }
00085
00086 bool
00087 CdbBdbSSimpleConfigIterator::isValid( )
00088 {
00089 return _isValid;
00090 }
00091
00092 CdbBdbSSimpleConfigIterator::InterfaceType*
00093 CdbBdbSSimpleConfigIterator::clone( ) const
00094 {
00095 return new CdbBdbSSimpleConfigIterator( *this );
00096 }
00097
00098
00099
00100