Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TSQLClassInfo.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/sql:$Id$
0002 // Author: Sergey Linev  20/11/2005
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TSQLClassInfo
0013 #define ROOT_TSQLClassInfo
0014 
0015 #include "TObject.h"
0016 
0017 #include "TString.h"
0018 
0019 class TObjArray;
0020 
0021 class TSQLClassColumnInfo final : public TObject {
0022 
0023 public:
0024    TSQLClassColumnInfo() {} // NOLINT: not allowed to use = default because of TObject::kIsOnHeap detection, see ROOT-10300
0025    TSQLClassColumnInfo(const char *name, const char *sqlname, const char *sqltype);
0026 
0027    const char *GetName() const final { return fName.Data(); }
0028    const char *GetSQLName() const { return fSQLName.Data(); }
0029    const char *GetSQLType() const { return fSQLType.Data(); }
0030 
0031 protected:
0032    TString fName;
0033    TString fSQLName;
0034    TString fSQLType;
0035 
0036    ClassDefOverride(TSQLClassColumnInfo, 1); //  Keeps information about single column in class table
0037 };
0038 
0039 //_________________________________________________________________________________
0040 
0041 class TSQLClassInfo final : public TObject {
0042 public:
0043    TSQLClassInfo() {} // NOLINT: not allowed to use = default because of TObject::kIsOnHeap detection, see ROOT-10300
0044    TSQLClassInfo(Long64_t classid, const char *classname, Int_t version);
0045    ~TSQLClassInfo() override;
0046 
0047    Long64_t GetClassId() const { return fClassId; }
0048 
0049    const char *GetName() const final { return fClassName.Data(); }
0050    Int_t GetClassVersion() const { return fClassVersion; }
0051 
0052    void SetClassTableName(const char *name) { fClassTable = name; }
0053    void SetRawTableName(const char *name) { fRawTable = name; }
0054 
0055    const char *GetClassTableName() const { return fClassTable.Data(); }
0056    const char *GetRawTableName() const { return fRawTable.Data(); }
0057 
0058    void SetTableStatus(TObjArray *columns = nullptr, Bool_t israwtable = kFALSE);
0059    void SetColumns(TObjArray *columns);
0060    void SetRawExist(Bool_t on) { fRawtableExist = on; }
0061 
0062    Bool_t IsClassTableExist() const { return GetColumns() != nullptr; }
0063    Bool_t IsRawTableExist() const { return fRawtableExist; }
0064 
0065    TObjArray *GetColumns() const { return fColumns; }
0066    Int_t FindColumn(const char *name, Bool_t sqlname = kFALSE);
0067 
0068 protected:
0069    TString fClassName;             ///<! class name
0070    Int_t fClassVersion{0};         ///<! class version
0071    Long64_t fClassId{0};           ///<! sql class id
0072    TString fClassTable;            ///<! name of table with class data
0073    TString fRawTable;              ///<! name of table with raw data
0074    TObjArray *fColumns{nullptr};   ///<! name and type of columns - array of TNamed
0075    Bool_t fRawtableExist{kFALSE};  ///<! indicate that raw table is exist
0076 
0077    ClassDefOverride(TSQLClassInfo, 1); //  Keeps the table information relevant for one class
0078 };
0079 
0080 #endif