#ifndef ROOT_TProtoClass
#define ROOT_TProtoClass
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
class TClass;
class TList;
class TRealData;
#include "TDataMember.h"
#include <vector>
class TProtoClass: public TNamed {
public:
struct TProtoRealData {
Long_t fOffset;
Int_t fDMIndex;
Int_t fLevel;
Int_t fClassIndex;
char fStatusFlag;
enum {
kIsObject = BIT(0),
kIsTransient = BIT(1),
kIsPointer = BIT(2),
kBitMask = 0x000000ff
};
public:
bool IsAClass() const { return fClassIndex >= 0; }
TProtoRealData() : fOffset(0), fDMIndex(-1), fLevel(0), fClassIndex(-1), fStatusFlag(0) {}
TProtoRealData(const TRealData *rd);
virtual ~TProtoRealData();
TRealData *CreateRealData(TClass *currentClass, TClass *parent, TRealData * parentData, int prevLevel) const;
Bool_t TestFlag(UInt_t f) const { return (Bool_t) ((fStatusFlag & f) != 0); }
void SetFlag(UInt_t f, Bool_t on = kTRUE) {
if (on)
fStatusFlag |= f & kBitMask;
else
fStatusFlag &= ~(f & kBitMask);
}
ClassDef(TProtoRealData, 3);
};
private:
TList *fBase;
TList *fEnums;
std::vector<TProtoRealData> fPRealData;
std::vector<TDataMember *> fData;
std::vector<TString> fDepClasses;
Int_t fSizeof;
Int_t fCanSplit;
Int_t fStreamerType;
Long_t fProperty;
Long_t fClassProperty;
Long_t fOffsetStreamer;
TProtoClass(const TProtoClass &) = delete;
TProtoClass &operator=(const TProtoClass &) = delete;
const char * GetClassName(Int_t index) const { return (index >= 0) ? fDepClasses[index].Data() : 0; }
static Int_t DataMemberIndex(TClass * cl, const char * name);
static TDataMember * FindDataMember(TClass * cl, Int_t index);
public:
TProtoClass():
fBase(0), fEnums(0), fSizeof(0), fCanSplit(0),
fStreamerType(0), fProperty(0), fClassProperty(0),
fOffsetStreamer(0) {
}
TProtoClass(TProtoClass *pc);
TProtoClass(TClass *cl);
virtual ~TProtoClass();
Bool_t FillTClass(TClass *pcl);
const TList *GetListOfEnums() {
return fEnums;
};
void Delete(Option_t *opt = "");
int GetSize() { return fSizeof; }
TList * GetBaseList() { return fBase; }
TList * GetEnumList() { return fEnums; }
std::vector<TProtoRealData> & GetPRDList() { return fPRealData; }
std::vector<TDataMember *> & GetData() { return fData; }
std::vector<TString> & GetDepClasses() { return fDepClasses; }
ClassDef(TProtoClass, 2);
};
#endif