00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00021
00022 #include "DatabaseInterface/test/DbiDemoData1.h"
00023 #include "MessageService/MsgService.h"
00024 #include "DatabaseInterface/DbiOutRowStream.h"
00025 #include "DatabaseInterface/DbiResultSet.h"
00026 #include "DatabaseInterface/DbiValidityRec.h"
00027
00028 ClassImp(DbiDemoData1)
00029
00030
00031
00032
00033
00034 CVSID("$Id: DbiDemoData1.cxx,v 1.9 2004/10/14 12:47:44 west Exp $\n \
00035 CVSID_DBIRESULTPTR ");
00036
00037
00038
00039
00040
00041 #include "DatabaseInterface/DbiResultPtr.tpl"
00042 template class DbiResultPtr<DbiDemoData1>;
00043
00044 #include "DatabaseInterface/DbiWriter.tpl"
00045 template class DbiWriter<DbiDemoData1>;
00046
00047
00048
00049
00050
00051
00052
00053 void DbiDemoData1::Fill(DbiResultSet& rs,
00054 const DbiValidityRec* ) {
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 if ( rs.TableName() != "DEMOASCIIDATA"
00080 && rs.TableName() != "DemoASCIIData" ) {
00081
00082
00083 rs >> fSubSystem >> fPedestal >> fGain1 >> fGain2;
00084
00085 }
00086
00087
00088 else {
00089 Int_t numCol = rs.NumCols();
00090
00091 for (Int_t curCol = 2; curCol <= numCol; ++curCol) {
00092 string colName = rs.CurColName();
00093 if ( colName == "SUBSYSTEM" ) rs >> fSubSystem;
00094 else if ( colName == "PEDESTAL" ) rs >> fPedestal;
00095 else if ( colName == "GAIN1" ) rs >> fGain1;
00096 else if ( colName == "GAIN2" ) rs >> fGain2;
00097 else {
00098 MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol
00099 << "(" << colName << ")"
00100 << "; not part of DbiDemoData1" << endl;
00101 rs.IncrementCurCol();
00102 }
00103 }
00104
00105 }
00106 }
00107
00108
00109 void DbiDemoData1::Store(DbiOutRowStream& ors,
00110 const DbiValidityRec* ) const {
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135 ors << fSubSystem << fPedestal << fGain1 << fGain2;
00136
00137 }
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169