#ifndef DBIRESULTKEY #define DBIRESULTKEY /** * * $Id: IDbiResultKey.hxx,v 1.1 2011/01/18 05:49:20 finch Exp $ * * \class COMET::IDbiResultKey * * * \brief * Concept Summarises the composition of a single IDbiResultSet. * * \brief * Purpose To serve as summary of a single query. * * Contact: A.Finch@lancaster.ac.uk * * */ #include #include #include #include "TObject.h" #include "IVldTimeStamp.hxx" namespace COMET { class IDbiResultKey; } std::ostream& operator<<(std::ostream& os, const COMET::IDbiResultKey& key); namespace COMET { class IDbiResultKey : public TObject { public: using TObject::Compare; // Constructors and destructors. IDbiResultKey(const IDbiResultKey* that = 0); IDbiResultKey(std::string tableName, std::string rowName, UInt_t seqno, COMET::IVldTimeStamp ts); virtual ~IDbiResultKey(); // State testing member functions std::string AsString() const; Float_t Compare(const IDbiResultKey* that) const; static const IDbiResultKey* GetEmptyKey() { return &fgEmptyKey; } Int_t GetNumVrecs() const { return fNumVRecKeys; } std::string GetTableRowName() const; Bool_t IsEqualTo(const IDbiResultKey* that) const { return this->Compare(that) == 1.; } // State changing member functions void AddVRecKey(UInt_t seqno, COMET::IVldTimeStamp ts); // push VRecKey put to the public: portion so that rootcint dict compiles /// Container for a SeqNo and CreationDate pair. struct VRecKey { VRecKey() : SeqNo(0), CreationDate() {} VRecKey(UInt_t seqno, COMET::IVldTimeStamp ts) : SeqNo(seqno), CreationDate(ts) {} UInt_t SeqNo; COMET::IVldTimeStamp CreationDate; }; private: static IDbiResultKey fgEmptyKey; // Data members /// Name of database table std::string fTableName; /// Name of row objects. std::string fRowName; /// Key for individual IDbiValidityRec std::list fVRecKeys; /// Optimisation: list::size() is slow! Int_t fNumVRecKeys; ClassDef(IDbiResultKey,1) // output string stream }; }; #endif // DBIRESULTKEY