Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

StDbDefaults.hh

Go to the documentation of this file.
00001 /*************************************************************************** 00002 * 00003 * $Id: StDbDefaults.hh,v 1.1 2001/01/22 18:37:53 porter Exp $ 00004 * 00005 * Author: R. Jeff Porter 00006 *************************************************************************** 00007 * 00008 * Description: Defualt values -> version, flavor, endTime, dbserver file 00009 * -> Used to be imbedded in code & in StDbDefs header. 00010 * now (Dec2000) separate file. 00011 * 00012 *************************************************************************** 00013 * 00014 * $Log: StDbDefaults.hh,v $ 00015 * Revision 1.1 2001/01/22 18:37:53 porter 00016 * Update of code needed in next year running. This update has little 00017 * effect on the interface (only 1 method has been changed in the interface). 00018 * Code also preserves backwards compatibility so that old versions of 00019 * StDbLib can read new table structures. 00020 * -Important features: 00021 * a. more efficient low-level table structure (see StDbSql.cc) 00022 * b. more flexible indexing for new systems (see StDbElememtIndex.cc) 00023 * c. environment variable override KEYS for each database 00024 * d. StMessage support & clock-time logging diagnostics 00025 * -Cosmetic features 00026 * e. hid stl behind interfaces (see new *Impl.* files) to again allow rootcint access 00027 * f. removed codes that have been obsolete for awhile (e.g. db factories) 00028 * & renamed some classes for clarity (e.g. tableQuery became StDataBaseI 00029 * and mysqlAccessor became StDbSql) 00030 * 00031 * 00032 * 00033 ***************************************************************************/ 00034 #ifndef STDBDEFAULTS_HH 00035 #define STDBDEFAULTS_HH 00036 00037 #include "StDbDefs.hh" 00038 #include <string.h> 00039 00040 class StDbDefaults { 00041 00042 private: 00043 00044 char mversion[64]; 00045 char mflavor[16]; 00046 unsigned int mprodTime; 00047 unsigned int mendTime; 00048 char mdbServerVar[16]; 00049 char mdbServerFile[16]; 00050 00051 StDbDefaults(); 00052 00053 static StDbDefaults* mInstance; 00054 00055 public: 00056 00057 static StDbDefaults* Instance(){ 00058 if(!mInstance)mInstance = new StDbDefaults; 00059 return mInstance; 00060 } 00061 00062 ~StDbDefaults() {}; 00063 00064 bool IsDefaultVersion(const char* version); 00065 bool IsDefaultFlavor(const char* flavor); 00066 char* printVersion(); 00067 char* printFlavor(); 00068 unsigned int getProdTime() const; 00069 unsigned int getEndTime() const; 00070 char* printDbServerVar(); 00071 char* printDbServerFile(); 00072 00073 char* getServerFileName(const dbFindServerMode mode); 00074 char* getFileName(const char* fileName); 00075 00076 }; 00077 00078 inline 00079 bool StDbDefaults::IsDefaultVersion(const char* version){ 00080 if(strcmp(version,mversion)==0)return true; 00081 return false; 00082 } 00083 00084 inline 00085 bool StDbDefaults::IsDefaultFlavor(const char* flavor){ 00086 if(strcmp(flavor,mflavor)==0)return true; 00087 return false; 00088 } 00089 00090 inline 00091 char* StDbDefaults::printVersion(){ return mversion; } 00092 00093 inline 00094 char* StDbDefaults::printFlavor() { return mflavor; } 00095 00096 inline 00097 unsigned int StDbDefaults::getProdTime() const { return mprodTime; } 00098 00099 inline 00100 unsigned int StDbDefaults::getEndTime() const { return mendTime; } 00101 00102 inline 00103 char* StDbDefaults::printDbServerVar() { return mdbServerVar; }; 00104 00105 inline 00106 char* StDbDefaults::printDbServerFile() { return mdbServerFile; }; 00107 #endif 00108 00109 00110 00111 00112

Generated on Thu Aug 24 14:45:25 2006 for Doxygen by doxygen 1.3.7