#include <RunInfoQuary.h>
Public Member Functions | |
RunInfoQuary () | |
Constructor has to be in this form. | |
virtual | ~RunInfoQuary () |
virtual int | runNo2ContextRange (int runNo, ContextRange &cr) |
virtual int | ContextRange2runNo (const ContextRange &cr) |
Definition at line 6 of file RunInfoQuary.h.
RunInfoQuary::RunInfoQuary | ( | ) | [inline] |
virtual RunInfoQuary::~RunInfoQuary | ( | ) | [inline, virtual] |
int RunInfoQuary::runNo2ContextRange | ( | int | runNo, | |
ContextRange & | cr | |||
) | [virtual] |
Definition at line 18 of file RunInfoQuary.cc.
00019 { 00020 //Get all the raw data files 00021 DbiSqlContext vc("1=1"); //WHERE clause 00022 00023 #ifdef I_LIKE_DUPLICITY 00024 DbiResultPtr<DaqRunInfo> rp("DaqRunInfo", vc); 00025 #else 00026 DbiResultPtr<GDaqRunInfo> rp("DaqRunInfo", vc); 00027 #endif 00028 00029 // Check number of entries in result set 00030 unsigned int numRows = rp.GetNumRows(); 00031 if (numRows < 1) 00032 { 00033 cout<<"No records is found in table DaqRunInfo"<<endl; 00034 return 0; 00035 } 00036 #ifdef I_LIKE_DUPLICITY 00037 const DaqRunInfo* row; 00038 #else 00039 const GDaqRunInfo* row; 00040 #endif 00041 unsigned int idx = 0; 00042 while(idx < numRows) 00043 { 00044 row = rp.GetRow(idx); 00045 if(runNo == row->GetRunNo()) break; 00046 idx++; 00047 } 00048 if(idx == numRows) 00049 { 00050 cout<<"no record of "<<runNo<<" run "<<endl; 00051 return 0; 00052 } 00053 DbiResult* res = row->GetOwner(); 00054 const DbiValidityRec vr = res->GetValidityRec(); 00055 cr = vr.GetContextRange(); 00056 return 1; 00057 }
int RunInfoQuary::ContextRange2runNo | ( | const ContextRange & | cr | ) | [virtual] |