| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

RunInfoQuary Class Reference

#include <RunInfoQuary.h>

List of all members.


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)

Detailed Description

Definition at line 6 of file RunInfoQuary.h.


Constructor & Destructor Documentation

RunInfoQuary::RunInfoQuary (  )  [inline]

Constructor has to be in this form.

Definition at line 10 of file RunInfoQuary.h.

00010 {}

virtual RunInfoQuary::~RunInfoQuary (  )  [inline, virtual]

Definition at line 11 of file RunInfoQuary.h.

00011 {}


Member Function Documentation

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]

Definition at line 59 of file RunInfoQuary.cc.

00060 {
00061   return 0;
00062 }


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:28:17 2011 for DBWriter by doxygen 1.4.7