TDbiConfigSet.hxx

Go to the documentation of this file.
00001 #ifndef DBICONFIGSET_H
00002 #define DBICONFIGSET_H
00003 
00004 /**
00005  *
00006  * $Id: TDbiConfigSet.hxx,v 1.1 2011/01/18 05:49:19 finch Exp $
00007  *
00008  * \class TDbiConfigSet
00009  *
00010  *
00011  * \brief
00012  * <b>Concept</b>  A concrete data type corresponding to a single row in a
00013  *   database table of configuration data.
00014  *
00015  * \brief
00016  * <b>Purpose</b> Table row proxy for all Config data.
00017  *
00018  * Contact: A.Finch@lancaster.ac.uk
00019  *
00020  *
00021  */
00022 
00023 #include <string>
00024 using std::string;
00025 
00026 #include <vector>
00027 using std::vector;
00028 
00029 #include "TDbiResultSetHandle.hxx"    //Needed for LinkDef
00030 #include "TDbiWriter.hxx"    //Needed for LinkDef
00031 
00032 #include "TDbiTableRow.hxx"
00033 #include "TDbiFieldType.hxx"
00034 #include <iosfwd>
00035 
00036 
00037 class TDbiConfigSet;
00038 class TDbiValidityRec;
00039 
00040 
00041 std::ostream& operator<<(std::ostream& s, const TDbiConfigSet& cfSet);
00042 
00043 
00044 class TDbiConfigSet : public TDbiTableRow
00045 {
00046 
00047 public:
00048 
00049 // Constructors and destructors.
00050   virtual ~TDbiConfigSet();
00051 
00052 // State testing member functions
00053 
00054   virtual TDbiTableRow* CreateTableRow() const {
00055                                               return new TDbiConfigSet; }
00056         Int_t GetAggregateNo() const { return fAggregateNo; }
00057        UInt_t GetNumParams() const { return fParams.size(); }
00058        string GetParamName(UInt_t parNo) const;
00059  TDbiFieldType GetParamType(UInt_t parNo) const;
00060        string GetParamValue(UInt_t parNo) const;
00061 
00062 // State changing member functions
00063          void Clear(const Option_t* = "") { fParams.clear(); }
00064          void PushBack(const string& name,
00065                        const string& value,
00066                        const TDbiFieldType& type);
00067          void SetAggregateNo(Int_t aggNo) { fAggregateNo = aggNo; }
00068 
00069 // I/O  member functions
00070   virtual void Fill(TDbiInRowStream& rs,
00071                     const TDbiValidityRec* vrec);
00072   virtual void Store(TDbiOutRowStream& ors,
00073                     const TDbiValidityRec* vrec) const;
00074 
00075 private:
00076 // Constructors and destructors.
00077 
00078 
00079 // Internal structures.
00080 /// Internal structure used by TDbiCfgDialog to store Name/Value/Type triplets
00081   struct Param {
00082     Param() {  }
00083     Param(const Param& that) {
00084                               *this = that;}
00085     Param(const string& name,
00086           const string& value,
00087           const TDbiFieldType& type) : Name(name), Value(value), Type(type) {
00088                                    }
00089    ~Param() {  }
00090 
00091     string Name;
00092     string Value;
00093     TDbiFieldType Type;
00094   };
00095 
00096 // Data members
00097 
00098 // Set of parameter, one per column.
00099   vector<Param*> fParams;
00100 
00101 /// Aggregate number or:-
00102 ///     -1 Non-aggregated data or multiple aggregates
00103 ///     -2 undefined aggregates
00104    Int_t fAggregateNo;
00105 
00106 ClassDef(TDbiConfigSet,0)    // Configuration data.
00107 
00108 };
00109 
00110 
00111 #endif  // DBICONFIGSET_H
00112 

Generated on 11 Aug 2013 for SKDatabase by  doxygen 1.6.1