00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "BaBar/BaBar.hh"
00010
00011 #if !defined(OO_DDL_TRANSLATION)
00012 #include "CdbBdbShared/CdbBdbSLeafNodeP.hh"
00013 #endif // OO_DDL_TRANSLATION
00014
00015
00016 using std::endl;
00017 using std::ostream;
00018
00019 template< typename E >
00020 CdbBdbSLeafNodeP<E>::CdbBdbSLeafNodeP( d_ULong theSize ) :
00021 CdbBdbSNodeP<E>( ),
00022 _data(theSize)
00023 { }
00024
00025 template< typename E >
00026 CdbBdbSLeafNodeP<E>::~CdbBdbSLeafNodeP( )
00027 { }
00028
00029 template< typename E >
00030 BdbStatus
00031 CdbBdbSLeafNodeP<E>::resize( d_ULong theNewSize,
00032 d_ULong theNumPerLeaf,
00033 d_ULong theNumPerDirectory )
00034 {
00035 _data.update( );
00036 return _data.resize( theNewSize );
00037 }
00038
00039 template< typename E >
00040 void
00041 CdbBdbSLeafNodeP<E>::setElementAt( d_ULong theIndex,
00042 const E& value,
00043 d_ULong theNumPerLeaf,
00044 d_ULong theNumPerDirectory )
00045 {
00046 ooUpdate( );
00047 _data.update( );
00048 _data[theIndex] = value;
00049 }
00050
00051 template< typename E >
00052 E
00053 CdbBdbSLeafNodeP<E>::elementAt( d_ULong theIndex,
00054 d_ULong theNumPerLeaf,
00055 d_ULong theNumPerDirectory ) const
00056 {
00057 return _data[theIndex];
00058 }
00059
00060 template< typename E >
00061 void
00062 CdbBdbSLeafNodeP<E>::dump( d_ULong numSpaces,
00063 ostream& o,
00064 bool dumpContentsFlag ) const
00065 {
00066 o << ooThis( ).sprint( ) << " : <LEAF> level = " << _level << ", size = " << _data.size( ) << endl;
00067
00068 if( dumpContentsFlag ) {
00069 d_ULong num = _data.size( );
00070 for( d_ULong i = 0; i < num; ++i ) {
00071 for( d_ULong j = 0; j < numSpaces; ++j ) o << ' ';
00072 o << " [" << i << "] " << _data[i] << endl;
00073 }
00074 }
00075 }
00076
00077
00078
00079