// -*- mode: c++ -*- // $Id: BrDbRevision.h,v 1.4 2001/11/26 18:37:41 videbaek Exp $ // $Author: videbaek $ // $Date: 2001/11/26 18:37:41 $ // $Copyright: 2000 Brahms Collaboration // #ifndef BRAT_BrRevision #define BRAT_BrRevision #ifndef ROOT_TObjArray #include "TObjArray.h" #endif #ifndef ROOT_TSQLServer #include "TSQLServer.h" #endif #ifndef ROOT_TSQLResult #include "TSQLResult.h" #endif #ifndef ROOT_TSQLRow #include "TSQLRow.h" #endif #ifndef BRAT_BrDbTable #include "BrDbTable.h" #endif #ifndef BRAT_BrDbQuery #include "BrDbQuery.h" #endif #define REVISION_NAME "Revision" class BrDbRevision : public BrDbTable { public: enum EDataType { kNull=0, kShort=1, kInt=2, kLong=5, kFloat=3, kDouble=4 }; private: Int_t fParameterID; // Reference to parameter entry Int_t fTypeID; // Reference to type of revision Int_t fValidStart; // Start time of validity for revision Int_t fValidEnd; // End time of validity for revision // Bool_t fCanonical; // Is this the default revision? Int_t fFromStart; // Start time for basis for revsion Int_t fFromEnd; // End time for basis for revsion Int_t fDate; // Date of creation Int_t fAuthorID; // Reference to author of revsion Char_t fComment[255]; // Comment field EDataType fDataType; // Copy of DataType Parameter from Parameter -- Beware.. Long_t fEntries; // Number of elements in array Long_t fBytes; // Number of bytes in blob Byte_t* fArray; // Array of binary data public: BrDbRevision(Int_t parameterId, Int_t validstart, Int_t validend, Int_t fromstart, Int_t fromend, Int_t typeId = -1, Int_t date = -1, Int_t authorId = -1, // Bool_t canonical = kFALSE, const Char_t* comment = 0, EDataType datatype = kNull, Int_t entries = 0, Long_t bytes = 0, void* array = 0); BrDbRevision(BrDbRevision* rev); static const Char_t* kTableName; static BrDbQuery* Create(void); static BrDbRevision* SingleInstance(TSQLRow*); static TObjArray* MultipleInstance(TSQLResult*); virtual BrDbQuery* Insert(void); virtual void SetParameterID(Int_t id) { fParameterID = id; } virtual void SetTypeID(Int_t id) { fTypeID = id; } virtual void SetValidStart(Int_t start) { fValidStart = start;} virtual void SetValidEnd(Int_t end) { fValidEnd = end; } virtual void SetFromStart(Int_t start) { fFromStart = start;} virtual void SetFromEnd(Int_t end) { fFromEnd = end; } virtual void SetDate(Int_t unixdate=-1); virtual void SetAuthorID(Int_t id) { fAuthorID = id; } virtual void SetComment(const Char_t* comment); virtual void SetArray(void* a); virtual void SetBytes(Long_t b) { fBytes = b; } virtual void SetDataType(EDataType t) { fDataType = t; } virtual void SetEntries(Int_t n) { fEntries = n; } // virtual void SetCanonical(Bool_t c) { fCanonical = c; } virtual Int_t GetParameterID(void) const { return fParameterID; } virtual Int_t GetTypeID(void) const { return fTypeID; } virtual Int_t GetValidStart(void) const { return fValidStart; } virtual Int_t GetValidEnd(void) const { return fValidEnd; } virtual Int_t GetFromStart(void) const { return fFromStart; } virtual Int_t GetFromEnd(void) const { return fFromEnd; } virtual Int_t GetDate(void) const { return fDate; } virtual Int_t GetAuthorID(void) const { return fAuthorID; } virtual const Char_t* GetComment(void) const { return fComment; } virtual void* GetArray(void) const { return fArray; } virtual Long_t GetBytes(void) const { return fBytes; } virtual EDataType GetDataType(void) const { return fDataType;} virtual Int_t GetEntries(void) const { return fEntries; } // virtual Bool_t IsCanonical(void) const { return fCanonical; } virtual void Print(Option_t* option="") const; ClassDef(BrDbRevision,3) // Revision Class for BRAHMS database } ; #endif