30 # define _QUOTE2_(name1,name2) _QUOTE_(name1##name2)
32 # define _QUOTE2_(name1,name2) _QUOTE_(_NAME1_(name1)name2)
39 #define _TableClassImp_(className,structName)
42 #define TableClassStreamerImp(className) \
43 void className::Streamer(TBuffer &R__b) { \
44 TTable::Streamer(R__b); }
47 #define TableClassImp(className,structName) \
48 const char* className::TableDictionary() \
49 {return TTable::TableDictionary(_QUOTE_(className),_QUOTE_(structName),fgColDescriptors);}\
50 _TableClassImp_(className,structName)
53 #define TableClassImpl(className,structName) \
54 TTableDescriptor *className::fgColDescriptors = 0; \
55 TableClassImp(className,structName) \
56 TableClassStreamerImp(className)
59 #define TableImpl(name) \
60 TTableDescriptor *_NAME2_(St_,name)::fgColDescriptors = 0; \
61 TableClassImp(_NAME2_(St_,name), _NAME2_(name,_st)) \
62 TableClassStreamerImp(_NAME2_(St_,name))
64 #define TableImp(name) TableClassImp(_NAME2_(St_,name),_QUOTE2_(St_,name))
66 #define ClassDefTable(className,structName) \
68 static const char* TableDictionary(); \
70 static TTableDescriptor *fgColDescriptors; \
71 virtual TTableDescriptor *GetDescriptorPointer() const { return fgColDescriptors;} \
72 virtual void SetDescriptorPointer(TTableDescriptor *list) { fgColDescriptors = list;} \
74 typedef structName* iterator; \
75 className() : TTable(_QUOTE_(className),sizeof(structName)) {SetType(_QUOTE_(structName));} \
76 className(const char *name) : TTable(name,sizeof(structName)) {SetType(_QUOTE_(structName));} \
77 className(Int_t n) : TTable(_QUOTE_(className),n,sizeof(structName)) {SetType(_QUOTE_(structName));}\
78 className(const char *name,Int_t n) : TTable(name,n,sizeof(structName)) {SetType(_QUOTE_(structName));}\
79 structName *GetTable(Int_t i=0) const { return ((structName *)GetArray())+i;} \
80 structName &operator[](Int_t i){ assert(i>=0 && i < GetNRows()); return *GetTable(i); } \
81 const structName &operator[](Int_t i) const { assert(i>=0 && i < GetNRows()); return *((const structName *)(GetTable(i))); } \
82 structName *begin() const { return GetNRows()? GetTable(0):0;}\
83 structName *end() const {Long_t i = GetNRows(); return i? GetTable(i):0;}
95 #define ClassDefineChair(classChairName,classTableName,structName) \
97 typedef structName* iterator; \
98 structName *GetTable(Int_t i) const { \
99 if (fLastIndx != UInt_t(i)) { \
100 ((classChairName *)this)->fLastIndx = i; \
101 ((classChairName *)this)->fLastRow = \
102 ((classTableName *)GetThisTable())->GetTable(i); \
103 }; return (structName *)fLastRow; }; \
104 structName &operator[](Int_t i){ assert(i>=0 && i < GetNRows()); return *GetTable(i); } \
105 const structName &operator[](Int_t i) const { assert(i>=0 && i < GetNRows()); return *((const structName *)(GetTable(i))); }\
106 structName *begin() const { return GetNRows()? GetTable(0):0;}\
107 structName *end() const {Int_t i = GetNRows(); return i? GetTable(i):0;}
113 #define ClassDefChair(className,structName) \
115 typedef structName* iterator; \
116 structName *GetTable(Int_t i) const { \
117 if (fLastIndx != UInt_t(i)) { \
118 ((_NAME2_(className,C) *)this)->fLastIndx = i; \
119 ((_NAME2_(className,C) *)this)->fLastRow = \
120 ((className *)GetThisTable())->GetTable(i); \
121 }; return (structName *)fLastRow; } \
122 structName &operator[](Int_t i){ assert(i>=0 && i < GetNRows()); return *GetTable(i); } \
123 const structName &operator[](Int_t i) const { assert(i>=0 && i < GetNRows()); return *((const structName *)(GetTable(i))); }\
124 structName *begin() const { return GetNRows()? GetTable(0):0;}\
125 structName *end() const {Int_t i = GetNRows(); return i? GetTable(i):0;}
134 static const char* fgStructName;
135 virtual TClass *CreateClass(
const char *cname, Version_t
id,
136 const std::type_info &info, TVirtualIsAProxy *isa,
137 const char *dfil,
const char *ifil,
138 Int_t dl, Int_t il)
const
140 TClass *cl = TDefaultInitBehavior::CreateClass(cname,
id, info, isa,
142 fgStructName = T::TableDictionary();
145 virtual void Unregister(
const char* classname)
const
147 TDefaultInitBehavior::Unregister(classname);
148 TDefaultInitBehavior::Unregister(fgStructName);
153 template <
class RootClass>