/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DbiResultPtr.h
Go to the documentation of this file.
00001 #ifndef DBIRESULTPTR_H
00002 #define DBIRESULTPTR_H
00003 
00028 #include <map>
00029 #include <string>
00030 using std::string;
00031 
00032 #include "DatabaseInterface/Dbi.h"
00033 #include "DatabaseInterface/DbiResult.h"
00034 #include "DatabaseInterface/DbiTableProxyRegistry.h"  //Only for cleaner
00035 #include "DatabaseInterface/DbiValidityRec.h"
00036 #include "Context/Context.h"
00037 
00038 class DbiResult;
00039 class DbiResultKey;
00040 class DbiSqlContext;
00041 class DbiTableProxy;
00042 
00043 template <class T> class DbiResultPtr
00044 {
00045 
00046 public:
00047 
00048 // Constructors and destructors.
00049            DbiResultPtr();
00050            DbiResultPtr(const DbiResultPtr& that);
00051            DbiResultPtr(const Context& vc,
00052                         Dbi::SubSite subsite = Dbi::kDefaultSubSite,
00053                         Dbi::Task task = Dbi::kDefaultTask,                        
00054                         Dbi::AbortTest abortTest = Dbi::kTableMissing,
00055                         Bool_t findFullTimeWindow = true);
00056            DbiResultPtr(const string& tableName,
00057                         const Context& vc,
00058                         Dbi::SubSite subsite = Dbi::kDefaultSubSite,
00059                         Dbi::Task task = Dbi::kDefaultTask,
00060                         Dbi::AbortTest abortTest = Dbi::kTableMissing,
00061                         Bool_t findFullTimeWindow = true);
00062            DbiResultPtr(const string& tableName,
00063                         const DbiSqlContext& context,
00064                         const Dbi::SubSite& subsite = Dbi::kAnySubSite, 
00065                         const Dbi::Task& task = Dbi::kAnyTask, 
00066                         const string& data = "",
00067                         const string& fillOpts = "",
00068                         Dbi::AbortTest abortTest = Dbi::kTableMissing);
00069            DbiResultPtr(const string& tableName,
00070                         const DbiValidityRec& vrec,
00071                         Dbi::AbortTest abortTest = Dbi::kTableMissing);
00072            DbiResultPtr(const string& tableName,
00073                         UInt_t seqNo,
00074                         UInt_t dbNo,
00075                         Dbi::AbortTest abortTest = Dbi::kTableMissing);
00076    virtual ~DbiResultPtr();
00077 
00078 
00079 // State testing member functions
00080   const DbiResultKey* GetKey() const;
00081                UInt_t GetNumRows() const;
00082      const DbiResult* GetResult() const { return fResult; }
00083                 Int_t GetResultID() const;
00084              const T* GetRow(UInt_t rowNum) const;
00085              const T* GetRowByIndex(UInt_t index) const;
00086 const DbiValidityRec* GetValidityRec(const DbiTableRow* row=0) const;
00087        DbiTableProxy& TableProxy() const;
00088                Bool_t ResultsFromDb() const;
00089 
00090     static DbiTableProxy& GetTableProxy(); 
00091     static DbiTableProxy& GetTableProxy(const string& tableName);
00092 
00093 // State changing member functions
00094     UInt_t NextQuery(Bool_t forwards = kTRUE);
00095     UInt_t NewQuery(Context vc, 
00096                     Dbi::SubSite subsite=0,
00097                     Dbi::Task task=0,
00098                     Bool_t findFullTimeWindow = true);
00099     UInt_t NewQuery(const DbiSqlContext& context,
00100                     const Dbi::SubSite& subsite = 0, 
00101                     const Dbi::Task& task = 0, 
00102                     const string& data = "",
00103                     const string& fillOpts = "");
00104     UInt_t NewQuery(const DbiValidityRec& vrec);
00105     UInt_t NewQuery(UInt_t seqNo,UInt_t dbNo);
00106 
00107 
00108 private:  
00109   void Disconnect();
00110   void SetContext(const DbiValidityRec& vrec);
00111 Bool_t ApplyAbortTest();
00112 
00113 // 12 Jun 2002: Disabled (not implemented)  assignment
00114 DbiResultPtr& operator=(const DbiResultPtr&);
00115 
00116 
00117 // Data members
00118 
00120   Dbi::AbortTest fAbortTest;  
00121 
00123   DbiTableProxy& fTableProxy; 
00124 
00125 
00126 // State from last query.
00127 
00129 const DbiResult* fResult;     
00130 
00132   Site::Site_t fSiteType;
00133 
00135   SimFlag::SimFlag_t fSimType;    
00136 
00137 #ifndef __CINT__ //  Hide map from CINT; it complains about missing Streamer() etc.
00138 static std::map<string,DbiTableProxy*> fgNameToProxy;
00139 #endif  // __CINT__      
00140 static             DbiTableProxy* fgTableProxy;
00141 
00142 // Removed: ClassDefT(DbiResultPtr<T>,0)  // ResultPtr for specific database table. 
00143 
00144 };
00145 // Removed: ClassDefT2(DbiResultPtr,T)
00146 
00147 #endif  // DBIRESULTPTR_H
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:56:45 for DatabaseInterface by doxygen 1.7.4