#ifndef DBICONFIGSET_H #define DBICONFIGSET_H /** * * $Id: IDbiConfigSet.hxx,v 1.1 2011/01/18 05:49:19 finch Exp $ * * \class COMET::IDbiConfigSet * * * \brief * Concept A concrete data type corresponding to a single row in a * database table of configuration data. * * \brief * Purpose Table row proxy for all Config data. * * Contact: A.Finch@lancaster.ac.uk * * */ #include using std::string; #include using std::vector; #include "IDbiResultSetHandle.hxx" //Needed for LinkDef #include "IDbiWriter.hxx" //Needed for LinkDef #include "IDbiTableRow.hxx" #include "IDbiFieldType.hxx" #include namespace COMET { class IDbiConfigSet; class IDbiValidityRec; } std::ostream& operator<<(std::ostream& s, const COMET::IDbiConfigSet& cfSet); namespace COMET { class IDbiConfigSet : public IDbiTableRow { public: // Constructors and destructors. virtual ~IDbiConfigSet(); // State testing member functions virtual IDbiTableRow* CreateTableRow() const { return new IDbiConfigSet; } Int_t GetAggregateNo() const { return fAggregateNo; } UInt_t GetNumParams() const { return fParams.size(); } string GetParamName(UInt_t parNo) const; IDbiFieldType GetParamType(UInt_t parNo) const; string GetParamValue(UInt_t parNo) const; // State changing member functions void Clear(const Option_t* = "") { fParams.clear(); } void PushBack(const string& name, const string& value, const IDbiFieldType& type); void SetAggregateNo(Int_t aggNo) { fAggregateNo = aggNo; } // I/O member functions virtual void Fill(IDbiInRowStream& rs, const IDbiValidityRec* vrec); virtual void Store(IDbiOutRowStream& ors, const IDbiValidityRec* vrec) const; private: // Constructors and destructors. // Internal structures. /// Internal structure used by IDbiCfgDialog to store Name/Value/Type triplets struct Param { Param() { } Param(const Param& that) { *this = that;} Param(const string& name, const string& value, const IDbiFieldType& type) : Name(name), Value(value), Type(type) { } ~Param() { } string Name; string Value; IDbiFieldType Type; }; // Data members // Set of parameter, one per column. vector fParams; /// Aggregate number or:- /// -1 Non-aggregated data or multiple aggregates /// -2 undefined aggregates Int_t fAggregateNo; ClassDef(IDbiConfigSet,0) // Configuration data. }; }; #endif // DBICONFIGSET_H