![]() |
|
|
Bdb packages | Design docs | Source docs | Guidelines | Recent releases |
|
Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members /BdbTrees/BdbMetaData.cc
Go to the documentation of this file.00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id $ 00004 // 00005 // Description: 00006 // Class BdbMetaData. Implementation file for the transient 00007 // collection meta-data class. 00008 // 00009 // Environment: 00010 // Software developed for the BaBar Detector at the SLAC B-Factory. 00011 // 00012 // Author List: 00013 // David R. Quarrie Original Author 00014 // 00015 // Copyright Information: 00016 // Copyright (C) 1994, 1995 Lawrence Berkeley Laboratory 00017 // 00018 // History: 00019 // secondary key null pointers as null strings. 00020 // 00021 //------------------------------------------------------------------------ 00022 00023 //----------------------- 00024 // This Class's Header -- 00025 //----------------------- 00026 #include "BdbTrees/BdbMetaData.hh" 00027 00028 //------------- 00029 // C Headers -- 00030 //------------- 00031 extern "C" { 00032 #include <assert.h> 00033 #include <stddef.h> 00034 #include <string.h> 00035 } 00036 00037 //--------------- 00038 // C++ Headers -- 00039 //--------------- 00040 #include <iostream.h> 00041 00042 //----------------------------------------------------------------------- 00043 // Local Macros, Typedefs, Structures, Unions and Forward Declarations -- 00044 //----------------------------------------------------------------------- 00045 00046 static const char rcsid[] = "$Id: BdbMetaData.cc,v 1.5 2000/04/08 16:33:05 quarrie Exp $"; 00047 00048 // ---------------------------------------- 00049 // -- Public Function Member Definitions -- 00050 // ---------------------------------------- 00051 00052 //---------------- 00053 // Constructors -- 00054 //---------------- 00055 00056 BdbMetaData::BdbMetaData( ) 00057 : BdbAbsWrapper( ) 00058 { 00059 } 00060 00061 BdbMetaData::BdbMetaData( BdbHandle(BdbMetaDataP)& theMetaData ) 00062 : BdbAbsWrapper( ) 00063 { 00064 setObject( theMetaData ); 00065 } 00066 00067 BdbMetaData::BdbMetaData( const BdbMetaData& theMetaData ) 00068 : BdbAbsWrapper( ) 00069 { 00070 BdbHandleAny theObj = theMetaData.object( ); 00071 setObject( theObj ); 00072 } 00073 00074 //--------------- 00075 // Destructors -- 00076 //--------------- 00077 00078 BdbMetaData::~BdbMetaData( ) 00079 { 00080 } 00081 00082 //------------- 00083 // Selectors -- 00084 //------------- 00085 00086 BdbStatus 00087 BdbMetaData::owner( BdbHandle(BdbPersObj)& theOwner ) const 00088 { 00089 BdbStatus result = BdbcError; 00090 if ( ! isNull( ) ) { 00091 result = persistent( )->owner( theOwner ); 00092 } 00093 return result; 00094 } 00095 00096 const char* 00097 BdbMetaData::name( ) const 00098 { 00099 return persistent( )->name( ); 00100 } 00101 00102 d_ULong 00103 BdbMetaData::numBools( ) const 00104 { 00105 d_ULong result = 0; 00106 if ( ! isNull( ) ) { 00107 result = persistent( )->numBools( ); 00108 } 00109 return result; 00110 } 00111 00112 d_ULong 00113 BdbMetaData::numFloats( ) const 00114 { 00115 d_ULong result = 0; 00116 if ( ! isNull( ) ) { 00117 result = persistent( )->numFloats( ); 00118 } 00119 return result; 00120 } 00121 00122 d_ULong 00123 BdbMetaData::numLongs( ) const 00124 { 00125 d_ULong result = 0; 00126 if ( ! isNull( ) ) { 00127 result = persistent( )->numLongs( ); 00128 } 00129 return result; 00130 } 00131 00132 d_ULong 00133 BdbMetaData::numStrings( ) const 00134 { 00135 d_ULong result = 0; 00136 if ( ! isNull( ) ) { 00137 result = persistent( )->numStrings( ); 00138 } 00139 return result; 00140 } 00141 00142 BdbStatus 00143 BdbMetaData::getBool( d_Boolean& value, const char* const key ) const 00144 { 00145 BdbStatus result = BdbcError; 00146 if ( ! isNull( ) ) { 00147 result = persistent( )->getBool( value, key ); 00148 } 00149 return result; 00150 } 00151 00152 BdbStatus 00153 BdbMetaData::getBool( d_Boolean& value, d_ULong index ) const 00154 { 00155 BdbStatus result = BdbcError; 00156 if ( ! isNull( ) ) { 00157 result = persistent( )->getBool( value, index ); 00158 } 00159 return result; 00160 } 00161 00162 const char* 00163 BdbMetaData::getBoolKey( d_ULong index ) const 00164 { 00165 const char* result = 0; 00166 if ( ! isNull( ) ) { 00167 result = persistent( )->getBoolKey( index ); 00168 } 00169 return result; 00170 } 00171 00172 BdbStatus 00173 BdbMetaData::getFloat( d_Float& value, const char* const key ) const 00174 { 00175 BdbStatus result = BdbcError; 00176 if ( ! isNull( ) ) { 00177 result = persistent( )->getFloat( value, key ); 00178 } 00179 return result; 00180 } 00181 00182 BdbStatus 00183 BdbMetaData::getFloat( d_Float& value, d_ULong index ) const 00184 { 00185 BdbStatus result = BdbcError; 00186 if ( ! isNull( ) ) { 00187 result = persistent( )->getFloat( value, index ); 00188 } 00189 return result; 00190 } 00191 00192 const char* 00193 BdbMetaData::getFloatKey( d_ULong index ) const 00194 { 00195 const char* result = 0; 00196 if ( ! isNull( ) ) { 00197 result = persistent( )->getFloatKey( index ); 00198 } 00199 return result; 00200 } 00201 00202 BdbStatus 00203 BdbMetaData::getLong( d_Long& value, const char* const key ) const 00204 { 00205 BdbStatus result = BdbcError; 00206 if ( ! isNull( ) ) { 00207 result = persistent( )->getLong( value, key ); 00208 } 00209 return result; 00210 } 00211 00212 BdbStatus 00213 BdbMetaData::getLong( d_Long& value, d_ULong index ) const 00214 { 00215 BdbStatus result = BdbcError; 00216 if ( ! isNull( ) ) { 00217 result = persistent( )->getLong( value, index ); 00218 } 00219 return result; 00220 } 00221 00222 const char* 00223 BdbMetaData::getLongKey( d_ULong index ) const 00224 { 00225 const char* result = 0; 00226 if ( ! isNull( ) ) { 00227 result = persistent( )->getLongKey( index ); 00228 } 00229 return result; 00230 } 00231 00232 const char* 00233 BdbMetaData::getString( const char* const key ) const 00234 { 00235 const char* result = 0; 00236 if ( ! isNull( ) ) { 00237 result = persistent( )->getString( key ); 00238 } 00239 return result; 00240 } 00241 00242 const char* 00243 BdbMetaData::getString( d_ULong index ) const 00244 { 00245 const char* result = 0; 00246 if ( ! isNull( ) ) { 00247 result = persistent( )->getString( index ); 00248 } 00249 return result; 00250 } 00251 00252 const char* 00253 BdbMetaData::getStringKey( d_ULong index ) const 00254 { 00255 const char* result = 0; 00256 if ( ! isNull( ) ) { 00257 result = persistent( )->getStringKey( index ); 00258 } 00259 return result; 00260 } 00261 00262 //------------- 00263 // Modifiers -- 00264 //------------- 00265 00266 BdbStatus 00267 BdbMetaData::putBool( d_Boolean value, const char* const key ) 00268 { 00269 BdbStatus result = BdbcError; 00270 if ( ! isNull( ) ) { 00271 result = persistent( )->putBool( value, key ); 00272 } 00273 return result; 00274 } 00275 00276 BdbStatus 00277 BdbMetaData::putFloat( d_Float value, const char* const key ) 00278 { 00279 BdbStatus result = BdbcError; 00280 if ( ! isNull( ) ) { 00281 result = persistent( )->putFloat( value, key ); 00282 } 00283 return result; 00284 } 00285 00286 BdbStatus 00287 BdbMetaData::putLong( d_Long value, const char* const key ) 00288 { 00289 BdbStatus result = BdbcError; 00290 if ( ! isNull( ) ) { 00291 result = persistent( )->putLong( value, key ); 00292 } 00293 return result; 00294 } 00295 00296 BdbStatus 00297 BdbMetaData::putString( const char* const value, const char* const key ) 00298 { 00299 BdbStatus result = BdbcError; 00300 if ( ! isNull( ) ) { 00301 result = persistent( )->putString( value, key ); 00302 } 00303 return result; 00304 } 00305 00306 BdbStatus 00307 BdbMetaData::deleteBool( const char* const key ) 00308 { 00309 BdbStatus result = BdbcError; 00310 if ( ! isNull( ) ) { 00311 result = persistent( )->deleteBool( key ); 00312 } 00313 return result; 00314 } 00315 00316 BdbStatus 00317 BdbMetaData::deleteFloat( const char* const key ) 00318 { 00319 BdbStatus result = BdbcError; 00320 if ( ! isNull( ) ) { 00321 result = persistent( )->deleteFloat( key ); 00322 } 00323 return result; 00324 } 00325 00326 BdbStatus 00327 BdbMetaData::deleteLong( const char* const key ) 00328 { 00329 BdbStatus result = BdbcError; 00330 if ( ! isNull( ) ) { 00331 result = persistent( )->deleteLong( key ); 00332 } 00333 return result; 00334 } 00335 00336 BdbStatus 00337 BdbMetaData::deleteString( const char* const key ) 00338 { 00339 BdbStatus result = BdbcError; 00340 if ( ! isNull( ) ) { 00341 result = persistent( )->deleteString( key ); 00342 } 00343 return result; 00344 } 00345 00346 BdbStatus 00347 BdbMetaData::clearAll( ) 00348 { 00349 BdbStatus result = BdbcError; 00350 if ( ! isNull( ) ) { 00351 result = persistent( )->clearAll( ); 00352 } 00353 return result; 00354 } 00355 00356 BdbStatus 00357 BdbMetaData::clearBools( ) 00358 { 00359 BdbStatus result = BdbcError; 00360 if ( ! isNull( ) ) { 00361 result = persistent( )->clearBools( ); 00362 } 00363 return result; 00364 } 00365 00366 BdbStatus 00367 BdbMetaData::clearFloats( ) 00368 { 00369 BdbStatus result = BdbcError; 00370 if ( ! isNull( ) ) { 00371 result = persistent( )->clearFloats( ); 00372 } 00373 return result; 00374 } 00375 00376 BdbStatus 00377 BdbMetaData::clearLongs( ) 00378 { 00379 BdbStatus result = BdbcError; 00380 if ( ! isNull( ) ) { 00381 result = persistent( )->clearLongs( ); 00382 } 00383 return result; 00384 } 00385 00386 BdbStatus 00387 BdbMetaData::clearStrings( ) 00388 { 00389 BdbStatus result = BdbcError; 00390 if ( ! isNull( ) ) { 00391 result = persistent( )->clearStrings( ); 00392 } 00393 return result; 00394 } 00395 00396 BdbStatus 00397 BdbMetaData::clone( BdbMetaData& theOther ) 00398 { 00399 BdbStatus result = BdbcError; 00400 if ( ! theOther.isNull( ) ) { 00401 BdbHandle(BdbMetaDataP) theOtherP = theOther.persistent( ); 00402 result = persistent( )->clone( theOtherP ); 00403 } 00404 return result; 00405 } 00406 00407 BdbHandle(BdbMetaDataP) 00408 BdbMetaData::persistent( ) const 00409 { 00410 assert( ! BdbIsNull( object( ) ) ); 00411 return (const BdbHandle(BdbMetaDataP)&) object( ); 00412 } 00413 00414 //------------- 00415 // Operators -- 00416 //------------- 00417 00418 BdbMetaData& 00419 BdbMetaData::operator=( const BdbMetaData& theOther ) 00420 { 00421 BdbHandleAny theObj = theOther.object( ); 00422 setObject( theObj ); 00423 return *this; 00424 } 00425 00426 // ------------------------------------------- 00427 // -- Protected Function Member Definitions -- 00428 // ------------------------------------------- 00429 00430 void 00431 BdbMetaData::setPersistent( BdbHandle(BdbMetaDataP)& theMetaData ) 00432 { 00433 BdbHandleAny theObj = theMetaData; 00434 setObject( theObj ); 00435 } 00436
BaBar Public Site | SLAC | News | Links | Who's Who | Contact Us
Page Owner: Jacek Becla
Last Update: October 04, 2002