Bdb packages | Design docs | Source docs | Guidelines | Recent releases

Search | Site Map .

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/BdbCond/BdbDataLists.cc

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //  $Id $
00004 //
00005 // Description:
00006 //  Class BdbDataLists. 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 //  Francesco Safai Tehrani     SLAC & INFN
00014 //
00015 // Copyright Information:
00016 //  Copyright (C) 1999   Stanford Linear Accelerator Center
00017 //
00018 //------------------------------------------------------------------------
00019 
00020 //-----------------------
00021 // This Class's Header --
00022 //-----------------------
00023 #include "BdbCond/BdbDataLists.hh"
00024 
00025 //-------------
00026 // C Headers --
00027 //-------------
00028 extern "C" {
00029 #include <assert.h>
00030 #include <stddef.h>
00031 #include <string.h>
00032 }
00033 
00034 //---------------
00035 // C++ Headers --
00036 //---------------
00037 #include <iostream.h>
00038 
00039 //-----------------------------------------------------------------------
00040 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00041 //-----------------------------------------------------------------------
00042 
00043 static const char rcsid[] = "$Id: BdbDataLists.cc,v 1.2 1999/10/22 22:29:33 romosan Exp $";
00044 
00045 //      ----------------------------------------
00046 //      -- Public Function Member Definitions --
00047 //      ----------------------------------------
00048 
00049 //----------------
00050 // Constructors --
00051 //----------------
00052 
00053 BdbDataLists::BdbDataLists(): BdbAbsWrapper()
00054 {
00055 }
00056 
00057 BdbDataLists::BdbDataLists(BdbHandle(BdbDataListsP)& theMetaData): BdbAbsWrapper()
00058 {
00059   setObject(theMetaData);
00060 }
00061 
00062 BdbDataLists::BdbDataLists(const BdbDataLists& theMetaData): BdbAbsWrapper()
00063 {
00064   BdbHandleAny theObj = theMetaData.object();
00065   setObject(theObj);
00066 }
00067 
00068 //---------------
00069 // Destructors --
00070 //---------------
00071 
00072 BdbDataLists::~BdbDataLists()
00073 {
00074 }
00075 
00076 //-------------
00077 // Selectors --
00078 //-------------
00079 
00080 const char* BdbDataLists::name() const
00081 {
00082   return persistent()->name();
00083 }
00084 
00085 d_ULong BdbDataLists::numBools() const
00086 {
00087   d_ULong result = 0;
00088   if (! isNull()) 
00089     {
00090       result = persistent()->numBools();
00091     }
00092   return result;
00093 }
00094 
00095 d_ULong BdbDataLists::numFloats() const
00096 {
00097   d_ULong result = 0;
00098   if (! isNull()) 
00099     {
00100       result = persistent()->numFloats();
00101     }
00102   return result;
00103 }
00104 
00105 d_ULong BdbDataLists::numLongs() const
00106 {
00107   d_ULong result = 0;
00108   if (! isNull()) 
00109     {
00110       result = persistent()->numLongs();
00111     }
00112   return result;
00113 }
00114 
00115 d_ULong BdbDataLists::numStrings() const
00116 {
00117   d_ULong result = 0;
00118   if (! isNull()) 
00119     {
00120       result = persistent()->numStrings();
00121     }
00122   return result;
00123 }
00124 
00125 BdbStatus BdbDataLists::getBool(d_Boolean& value, const char* const key) const
00126 {
00127   BdbStatus result = BdbcError;
00128   if (! isNull()) 
00129     {
00130       result = persistent()->getBool(value, key);
00131     }
00132   return result;
00133 }
00134 
00135 BdbStatus BdbDataLists::getBool(d_Boolean& value, d_ULong index) const
00136 {
00137   BdbStatus result = BdbcError;
00138   if (! isNull()) 
00139     {
00140       result = persistent()->getBool(value, index);
00141     }
00142   return result;
00143 }
00144 
00145 const char* BdbDataLists::getBoolKey(d_ULong index) const
00146 {
00147   const char* result = 0;
00148   if (! isNull()) 
00149     {
00150       result = persistent()->getBoolKey(index);
00151     }
00152   return result;
00153 }
00154 
00155 BdbStatus BdbDataLists::getFloat(d_Float& value, const char* const key) const
00156 {
00157   BdbStatus result = BdbcError;
00158   if (! isNull()) 
00159     {
00160       result = persistent()->getFloat(value, key);
00161     }
00162   return result;
00163 }
00164 
00165 BdbStatus BdbDataLists::getFloat(d_Float& value, d_ULong index) const
00166 {
00167   BdbStatus result = BdbcError;
00168   if (! isNull()) 
00169     {
00170       result = persistent()->getFloat(value, index);
00171     }
00172   return result;
00173 }
00174 
00175 const char* BdbDataLists::getFloatKey(d_ULong index) const
00176 {
00177   const char* result = 0;
00178     if (! isNull()) 
00179       {
00180         result = persistent()->getFloatKey(index);
00181       }
00182     return result;
00183 }
00184 
00185 BdbStatus BdbDataLists::getLong(d_Long& value, const char* const key) const
00186 {
00187   BdbStatus result = BdbcError;
00188   if (! isNull()) 
00189     {
00190       result = persistent()->getLong(value, key);
00191     }
00192   return result;
00193 }
00194 
00195 BdbStatus BdbDataLists::getLong(d_Long& value, d_ULong index) const
00196 {
00197   BdbStatus result = BdbcError;
00198   if (! isNull()) 
00199     {
00200       result = persistent()->getLong(value, index);
00201     }
00202   return result;
00203 }
00204 
00205 const char* BdbDataLists::getLongKey(d_ULong index) const
00206 {
00207   const char* result = 0;
00208   if (! isNull()) 
00209     {
00210         result = persistent()->getLongKey(index);
00211     }
00212   return result;
00213 }
00214 
00215 const char* BdbDataLists::getString(const char* const key) const
00216 {
00217   const char* result = 0;
00218   if (! isNull()) 
00219     {
00220       result = persistent()->getString(key);
00221     }
00222   return result;
00223 }
00224 
00225 const char* BdbDataLists::getString(d_ULong index) const
00226 {
00227   const char* result = 0;
00228   if (! isNull()) 
00229     {
00230         result = persistent()->getString(index);
00231     }
00232   return result;
00233 }
00234 
00235 const char* BdbDataLists::getStringKey(d_ULong index) const
00236 {
00237   const char* result = 0;
00238   if (! isNull()) 
00239     {
00240       result = persistent()->getStringKey(index);
00241     }
00242   return result;
00243 }
00244 
00245 //-------------
00246 // Modifiers --
00247 //-------------
00248 
00249 BdbStatus BdbDataLists::putBool(d_Boolean value, const char* const key)
00250 {
00251   BdbStatus result = BdbcError;
00252   if (! isNull()) 
00253     {
00254       result = persistent()->putBool(value, key);
00255     }
00256   return result;
00257 }
00258 
00259 BdbStatus BdbDataLists::putFloat(d_Float value, const char* const key)
00260 {
00261   BdbStatus result = BdbcError;
00262   if (! isNull()) 
00263     {
00264       result = persistent()->putFloat(value, key);
00265     }
00266   return result;
00267 }
00268 
00269 BdbStatus BdbDataLists::putLong(d_Long value, const char* const key)
00270 {
00271   BdbStatus result = BdbcError;
00272   if (! isNull()) 
00273     {
00274       result = persistent()->putLong(value, key);
00275     }
00276   return result;
00277 }
00278 
00279 BdbStatus BdbDataLists::putString(const char* const value, const char* const key)
00280 {
00281   BdbStatus result = BdbcError;
00282   if (! isNull())
00283     {
00284       result = persistent()->putString(value, key);
00285     }
00286   return result;
00287 }
00288 
00289 BdbHandle(BdbDataListsP) BdbDataLists::persistent() const
00290 {
00291   assert(! BdbIsNull(object()));
00292   return (const BdbHandle(BdbDataListsP)&) object();
00293 }
00294 
00295 //-------------
00296 // Operators --
00297 //-------------
00298 
00299 BdbDataLists& BdbDataLists::operator=(const BdbDataLists& theOther)
00300 {
00301   BdbHandleAny theObj = theOther.object();
00302   setObject(theObj);
00303   return *this;
00304 }
00305 
00306 //      -------------------------------------------
00307 //      -- Protected Function Member Definitions --
00308 //      -------------------------------------------
00309 
00310 void BdbDataLists::setPersistent(BdbHandle(BdbDataListsP)& theMetaData)
00311 {
00312   BdbHandleAny theObj = theMetaData;
00313   setObject(theObj);
00314 }
00315 

 


BaBar Public Site | SLAC | News | Links | Who's Who | Contact Us

Page Owner: Jacek Becla
Last Update: October 04, 2002