Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DbiConfigSet.h

Go to the documentation of this file.
00001 #ifndef DBICONFIGSET_H
00002 #define DBICONFIGSET_H
00003 
00024 #include <string>
00025 using std::string;
00026 
00027 #include <vector>
00028 using std::vector;
00029 
00030 #include "DatabaseInterface/DbiTableRow.h"
00031 #include "DatabaseInterface/DbiFieldType.h"
00032 #include "LeakChecker/Lea.h"
00033 #include <iosfwd>
00034 
00035 class DbiConfigSet;
00036 class DbiValidityRec;
00037 
00038 std::ostream& operator<<(std::ostream& s, const DbiConfigSet& cfSet);    
00039 
00040 class DbiConfigSet : public DbiTableRow
00041 {
00042 
00043 public:
00044 
00045 // Constructors and destructors.
00046   DbiConfigSet() : fAggregateNo(-2) { LEA_CTOR; }
00047   virtual ~DbiConfigSet();
00048 
00049 // State testing member functions
00050  
00051   virtual DbiTableRow* CreateTableRow() const { 
00052                                               return new DbiConfigSet; }
00053         Int_t GetAggregateNo() const { return fAggregateNo; }
00054        UInt_t GetNumParams() const { return fParams.size(); }
00055        string GetParamName(UInt_t parNo) const;
00056  DbiFieldType GetParamType(UInt_t parNo) const;
00057        string GetParamValue(UInt_t parNo) const;
00058 
00059 // State changing member functions
00060          void Clear(const Option_t* = "") { fParams.clear(); }
00061          void PushBack(const string& name,
00062                        const string& value,
00063                        const DbiFieldType& type);
00064          void SetAggregateNo(Int_t aggNo) { fAggregateNo = aggNo; }
00065 
00066 // I/O  member functions
00067   virtual void Fill(DbiResultSet& rs,
00068                     const DbiValidityRec* vrec);
00069   virtual void Store(DbiOutRowStream& ors,
00070                     const DbiValidityRec* vrec) const;
00071 
00072 private:  
00073 // Constructors and destructors.
00074   DbiConfigSet(const DbiConfigSet& from); // No! { LEA_CTOR; *this = from; }
00075 
00076   
00077 // Internal structures.
00078 
00079   struct Param {
00080     Param() { LEA_CTOR_NM("DbiConfigSet::Param",this); }
00081     Param(const Param& that) {LEA_CTOR_NM("DbiConfigSet::Param",this);
00082                               *this = that;}
00083     Param(const string& name,
00084           const string& value,
00085           const DbiFieldType& type) : Name(name), Value(value), Type(type) {
00086                                   LEA_CTOR_NM("DbiConfigSet::Param",this); }
00087    ~Param() { LEA_DTOR_NM("DbiConfigSet::Param",this); }
00088 
00089     string Name;
00090     string Value;
00091     DbiFieldType Type;
00092   };
00093 
00094 // Data members
00095 
00096 // Set of parameter, one per column.
00097   vector<Param*> fParams;
00098 
00102    Int_t fAggregateNo;
00103 
00104 ClassDef(DbiConfigSet,0)    // Configuration data. 
00105 
00106 };
00107 
00108 
00109 #endif  // DBICONFIGSET_H

Generated on Mon Feb 15 11:06:34 2010 for loon by  doxygen 1.3.9.1