#ifndef DBICONFIGSTREAM_H #define DBICONFIGSTREAM_H /** * * $Id: IDbiConfigStream.hxx,v 1.1 2011/01/18 05:49:19 finch Exp $ * * \class COMET::IDbiConfigStream * * * \brief * Concept I/O of configuration data and equivalent IDbiRegistry objs. * * \brief * Purpose Used to fill/store IDbiRegistry objects. * * Contact: A.Finch@lancaster.ac.uk * * */ #include #include "IDbi.hxx" #include "IDbiConfigSet.hxx" #include "IDbiResultSetHandle.hxx" #include "IDbiRegistry.hxx" #include "IVldContext.hxx" namespace COMET { class IDbiConfigStream; class IDbiFieldType; } namespace COMET{ class IDbiRegistry; } #include std::ostream& operator<<(std::ostream& s, const COMET::IDbiConfigStream& cfStream); namespace COMET { class IDbiConfigStream { public: static COMET::IVldContext fgDefaultContext; // Constructors and destructors. IDbiConfigStream(); IDbiConfigStream(const std::string& SoftwName, const std::string& ConfigName="default", COMET::IVldContext vc = IDbiConfigStream::fgDefaultContext, IDbi::Task task=0, const std::string& tableName="SOFTWARE_CONFIGURATION"); virtual ~IDbiConfigStream(); // State testing member functions const COMET::IDbiConfigStream& operator>>(IDbiRegistry* reg); const IDbiConfigSet* GetConfigSet() const { return fCFSet; } // State changing member functions COMET::IDbiConfigStream& operator<<(const IDbiRegistry* reg); Bool_t IsEmpty() { return fCFSet == 0; } IDbiValidityRec& GetValidityRec() { return fVRec; } Bool_t Write(UInt_t dbNo = 0, const std::string& logComment = "", Bool_t localTest = false); private: IDbiConfigStream(const IDbiConfigStream&); // Not implimented // Data members /// Pointer to the associated configuration set. May point either /// to a row of fCFSetTable (or 0) or, after operator <<, to fCFSetModified const IDbiConfigSet* fCFSet; /// Pointer to ConfigSet table COMET::IDbiResultSetHandle fCFSetTable; /// Local COMET::IDbiConfigSet (empty until/unless filled using operator <<). IDbiConfigSet fCFSetModified; /// Associated validity rec (used when writing back to the database). IDbiValidityRec fVRec; /// Name of the configuration set std::string fConfigName; /// Name of the software system to be configured std::string fSoftwName; ClassDef(IDbiConfigStream,0) // Input/output stream of configuration data }; }; #endif // DBICONFIGSTREAM_H