#ifndef ROOT_TSQLObjectData
#define ROOT_TSQLObjectData
#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
class TObjArray;
class TList;
class TSQLClassInfo;
class TSQLResult;
class TSQLRow;
class TSQLStatement;
class TSQLObjectInfo : public TObject {
public:
TSQLObjectInfo();
TSQLObjectInfo(Long64_t objid, const char* classname, Version_t version);
virtual ~TSQLObjectInfo();
Long64_t GetObjId() const { return fObjId; }
const char* GetObjClassName() const { return fClassName.Data(); }
Version_t GetObjVersion() const { return fVersion; }
protected:
Long64_t fObjId;
TString fClassName;
Version_t fVersion;
ClassDef(TSQLObjectInfo, 1)
};
class TSQLObjectData : public TObject {
public:
TSQLObjectData();
TSQLObjectData(TSQLClassInfo* sqlinfo,
Long64_t objid,
TSQLResult* classdata,
TSQLRow* classrow,
TSQLResult* blobdata,
TSQLStatement* blobstmt);
virtual ~TSQLObjectData();
Long64_t GetObjId() const { return fObjId; }
TSQLClassInfo* GetInfo() const { return fInfo; }
Bool_t LocateColumn(const char* colname, Bool_t isblob = kFALSE);
Bool_t IsBlobData() const { return fCurrentBlob || (fUnpack!=0); }
void ShiftToNextValue();
void AddUnpack(const char* tname, const char* value);
void AddUnpackInt(const char* tname, Int_t value);
const char* GetValue() const { return fLocatedValue; }
const char* GetLocatedField() const { return fLocatedField; }
const char* GetBlobPrefixName() const { return fBlobPrefixName; }
const char* GetBlobTypeName() const { return fBlobTypeName; }
Bool_t VerifyDataType(const char* tname, Bool_t errormsg = kTRUE);
Bool_t PrepareForRawData();
protected:
Bool_t ExtractBlobValues();
Bool_t ShiftBlobRow();
Int_t GetNumClassFields();
const char* GetClassFieldName(Int_t n);
TSQLClassInfo* fInfo;
Long64_t fObjId;
Bool_t fOwner;
TSQLResult* fClassData;
TSQLResult* fBlobData;
TSQLStatement* fBlobStmt;
Int_t fLocatedColumn;
TSQLRow* fClassRow;
TSQLRow* fBlobRow;
const char* fLocatedField;
const char* fLocatedValue;
Bool_t fCurrentBlob;
const char* fBlobPrefixName;
const char* fBlobTypeName;
TObjArray* fUnpack;
ClassDef(TSQLObjectData, 1)
};
class TSQLObjectDataPool : public TObject {
public:
TSQLObjectDataPool();
TSQLObjectDataPool(TSQLClassInfo* info, TSQLResult* data);
virtual ~TSQLObjectDataPool();
TSQLClassInfo* GetSqlInfo() const { return fInfo; }
TSQLResult* GetClassData() const { return fClassData; }
TSQLRow* GetObjectRow(Long64_t objid);
protected:
TSQLClassInfo* fInfo;
TSQLResult* fClassData;
Bool_t fIsMoreRows;
TList* fRowsPool;
ClassDef(TSQLObjectDataPool,1)
};
#endif