00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TFormLeafInfo
00013 #define ROOT_TFormLeafInfo
00014
00015 #ifndef ROOT_TObject
00016 #include "TObject.h"
00017 #endif
00018
00019 #ifndef ROOT_TLeafElement
00020 #include "TLeafElement.h"
00021 #endif
00022
00023 #include "TArrayI.h"
00024 #include "TDataType.h"
00025 #include "TStreamerInfo.h"
00026 #include "TStreamerElement.h"
00027
00028
00029 class TFormLeafInfo : public TObject {
00030 public:
00031
00032 TFormLeafInfo(TClass* classptr = 0, Long_t offset = 0,
00033 TStreamerElement* element = 0);
00034 TFormLeafInfo(const TFormLeafInfo& orig);
00035 virtual TFormLeafInfo* DeepCopy() const;
00036 virtual ~TFormLeafInfo();
00037
00038
00039 TClass *fClass;
00040
00041 Long_t fOffset;
00042 TStreamerElement *fElement;
00043
00044
00045 TFormLeafInfo *fCounter;
00046 TFormLeafInfo *fNext;
00047 TString fClassName;
00048 TString fElementName;
00049
00050 protected:
00051 Int_t fMultiplicity;
00052 public:
00053
00054 virtual void AddOffset(Int_t offset, TStreamerElement* element);
00055
00056 virtual Int_t GetArrayLength();
00057 virtual TClass* GetClass() const;
00058 virtual Int_t GetCounterValue(TLeaf* leaf);
00059 virtual Int_t ReadCounterValue(char *where);
00060
00061 char* GetObjectAddress(TLeafElement* leaf, Int_t &instance);
00062
00063 Int_t GetMultiplicity();
00064
00065
00066 Int_t GetNdata(TLeaf* leaf);
00067 virtual Int_t GetNdata();
00068
00069 virtual Double_t GetValue(TLeaf *leaf, Int_t instance = 0);
00070
00071 virtual void *GetValuePointer(TLeaf *leaf, Int_t instance = 0);
00072 virtual void *GetValuePointer(char *from, Int_t instance = 0);
00073 virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
00074 virtual void *GetLocalValuePointer( char *from, Int_t instance = 0);
00075
00076 virtual Bool_t HasCounter() const;
00077 virtual Bool_t IsString() const;
00078
00079 virtual Bool_t IsInteger() const;
00080 virtual Bool_t IsReference() const { return kFALSE; }
00081
00082
00083 virtual Int_t GetPrimaryIndex();
00084 virtual Int_t GetVarDim();
00085 virtual Int_t GetVirtVarDim();
00086 virtual Int_t GetSize(Int_t index);
00087 virtual Int_t GetSumOfSizes();
00088 virtual void LoadSizes(TBranch* branch);
00089 virtual void SetPrimaryIndex(Int_t index);
00090 virtual void SetSecondaryIndex(Int_t index);
00091 virtual void SetSize(Int_t index, Int_t val);
00092 virtual void SetBranch(TBranch* br) { if ( fNext ) fNext->SetBranch(br); }
00093 virtual void UpdateSizes(TArrayI *garr);
00094
00095 virtual Double_t ReadValue(char *where, Int_t instance = 0);
00096
00097 virtual Bool_t Update();
00098 };
00099
00100
00101
00102
00103
00104
00105 class TFormLeafInfoDirect : public TFormLeafInfo {
00106 public:
00107 TFormLeafInfoDirect(TBranchElement * from);
00108 TFormLeafInfoDirect(const TFormLeafInfoDirect& orig);
00109 virtual TFormLeafInfo* DeepCopy() const;
00110 virtual ~TFormLeafInfoDirect();
00111
00112 virtual Double_t ReadValue(char * , Int_t = 0);
00113 virtual Double_t GetValue(TLeaf *leaf, Int_t instance = 0);
00114 virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
00115 virtual void *GetLocalValuePointer(char *thisobj, Int_t instance = 0);
00116 };
00117
00118
00119
00120
00121
00122
00123
00124 class TFormLeafInfoNumerical : public TFormLeafInfo {
00125 public:
00126 EDataType fKind;
00127 Bool_t fIsBool;
00128 TFormLeafInfoNumerical(TVirtualCollectionProxy *holder_of);
00129 TFormLeafInfoNumerical(EDataType kind);
00130 TFormLeafInfoNumerical(const TFormLeafInfoNumerical& orig);
00131 virtual TFormLeafInfo* DeepCopy() const;
00132 virtual ~TFormLeafInfoNumerical();
00133 virtual Bool_t IsString() const;
00134 virtual Bool_t Update();
00135 };
00136
00137
00138
00139
00140
00141
00142
00143 class TFormLeafInfoCollectionObject : public TFormLeafInfo {
00144 Bool_t fTop;
00145 public:
00146 TFormLeafInfoCollectionObject(TClass* classptr = 0, Bool_t fTop = kTRUE);
00147
00148 virtual TFormLeafInfo* DeepCopy() const {
00149 return new TFormLeafInfoCollectionObject(*this);
00150 }
00151
00152 virtual Int_t GetCounterValue(TLeaf* leaf);
00153 virtual Double_t ReadValue(char *where, Int_t instance = 0);
00154 virtual Double_t GetValue(TLeaf *leaf, Int_t instance = 0);
00155 virtual void *GetValuePointer(TLeaf *leaf, Int_t instance = 0);
00156 virtual void *GetValuePointer(char *thisobj, Int_t instance = 0);
00157 virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
00158 virtual void *GetLocalValuePointer(char *thisobj, Int_t instance = 0);
00159 };
00160
00161
00162
00163
00164
00165
00166 class TFormLeafInfoClones : public TFormLeafInfo {
00167 public:
00168 Bool_t fTop;
00169
00170 TFormLeafInfoClones(TClass* classptr = 0, Long_t offset = 0);
00171 TFormLeafInfoClones(TClass* classptr, Long_t offset, Bool_t top);
00172 TFormLeafInfoClones(TClass* classptr, Long_t offset, TStreamerElement* element,
00173 Bool_t top = kFALSE);
00174 virtual TFormLeafInfo* DeepCopy() const {
00175 return new TFormLeafInfoClones(*this);
00176 }
00177
00178 virtual Int_t GetCounterValue(TLeaf* leaf);
00179 virtual Int_t ReadCounterValue(char *where);
00180 virtual Double_t ReadValue(char *where, Int_t instance = 0);
00181 virtual Double_t GetValue(TLeaf *leaf, Int_t instance = 0);
00182 virtual void *GetValuePointer(TLeaf *leaf, Int_t instance = 0);
00183 virtual void *GetValuePointer(char *thisobj, Int_t instance = 0);
00184 virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
00185 virtual void *GetLocalValuePointer(char *thisobj, Int_t instance = 0);
00186 };
00187
00188
00189
00190
00191
00192
00193
00194 class TFormLeafInfoCollection : public TFormLeafInfo {
00195 public:
00196 Bool_t fTop;
00197
00198 TClass *fCollClass;
00199 TString fCollClassName;
00200 TVirtualCollectionProxy *fCollProxy;
00201 TStreamerElement *fLocalElement;
00202
00203 TFormLeafInfoCollection(TClass* classptr,
00204 Long_t offset,
00205 TStreamerElement* element,
00206 Bool_t top = kFALSE);
00207
00208 TFormLeafInfoCollection(TClass* motherclassptr,
00209 Long_t offset = 0,
00210 TClass* elementclassptr = 0,
00211 Bool_t top = kFALSE);
00212
00213 TFormLeafInfoCollection();
00214 TFormLeafInfoCollection(const TFormLeafInfoCollection& orig);
00215
00216 ~TFormLeafInfoCollection();
00217
00218 virtual TFormLeafInfo* DeepCopy() const;
00219
00220 virtual Bool_t Update();
00221
00222 virtual Int_t GetCounterValue(TLeaf* leaf);
00223 virtual Int_t ReadCounterValue(char* where);
00224 virtual Int_t GetCounterValue(TLeaf* leaf, Int_t instance);
00225 virtual Bool_t HasCounter() const;
00226 virtual Double_t ReadValue(char *where, Int_t instance = 0);
00227 virtual Double_t GetValue(TLeaf *leaf, Int_t instance = 0);
00228 virtual void *GetValuePointer(TLeaf *leaf, Int_t instance = 0);
00229 virtual void *GetValuePointer(char *thisobj, Int_t instance = 0);
00230 virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
00231 virtual void *GetLocalValuePointer(char *thisobj, Int_t instance = 0);
00232 };
00233
00234
00235
00236
00237
00238 class TFormLeafInfoCollectionSize : public TFormLeafInfo {
00239 TClass *fCollClass;
00240 TString fCollClassName;
00241 TVirtualCollectionProxy *fCollProxy;
00242 public:
00243 TFormLeafInfoCollectionSize(TClass*);
00244 TFormLeafInfoCollectionSize(TClass* classptr,Long_t offset,TStreamerElement* element);
00245 TFormLeafInfoCollectionSize();
00246 TFormLeafInfoCollectionSize(const TFormLeafInfoCollectionSize& orig);
00247
00248 ~TFormLeafInfoCollectionSize();
00249
00250 virtual TFormLeafInfo* DeepCopy() const;
00251
00252 virtual Bool_t Update();
00253
00254 virtual void *GetValuePointer(TLeaf *leaf, Int_t instance = 0);
00255 virtual void *GetValuePointer(char *from, Int_t instance = 0);
00256 virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
00257 virtual void *GetLocalValuePointer( char *from, Int_t instance = 0);
00258 virtual Double_t ReadValue(char *where, Int_t instance = 0);
00259 };
00260
00261
00262
00263
00264
00265
00266 class TFormLeafInfoPointer : public TFormLeafInfo {
00267 public:
00268 TFormLeafInfoPointer(TClass* classptr = 0, Long_t offset = 0,
00269 TStreamerElement* element = 0);
00270 TFormLeafInfoPointer(const TFormLeafInfoPointer& orig);
00271
00272 virtual TFormLeafInfo* DeepCopy() const;
00273
00274 virtual Double_t ReadValue(char *where, Int_t instance = 0);
00275 virtual Double_t GetValue(TLeaf *leaf, Int_t instance = 0);
00276 };
00277
00278
00279
00280
00281
00282
00283 class TFormLeafInfoMethod : public TFormLeafInfo {
00284
00285 TMethodCall *fMethod;
00286 TString fMethodName;
00287 TString fParams;
00288 Double_t fResult;
00289 TString fCopyFormat;
00290 TString fDeleteFormat;
00291 void *fValuePointer;
00292 Bool_t fIsByValue;
00293
00294 public:
00295
00296 TFormLeafInfoMethod(TClass* classptr = 0, TMethodCall *method = 0);
00297 TFormLeafInfoMethod(const TFormLeafInfoMethod& orig);
00298 ~TFormLeafInfoMethod();
00299
00300 virtual TFormLeafInfo* DeepCopy() const;
00301
00302 virtual TClass* GetClass() const;
00303 virtual void *GetLocalValuePointer( TLeaf *from, Int_t instance = 0);
00304 virtual void *GetLocalValuePointer(char *from, Int_t instance = 0);
00305 virtual Bool_t IsInteger() const;
00306 virtual Bool_t IsString() const;
00307 virtual Double_t ReadValue(char *where, Int_t instance = 0);
00308 virtual Bool_t Update();
00309 };
00310
00311
00312
00313
00314
00315
00316
00317
00318 class TFormLeafInfoMultiVarDim : public TFormLeafInfo {
00319 public:
00320 Int_t fNsize;
00321 TArrayI fSizes;
00322 TFormLeafInfo *fCounter2;
00323 Int_t fSumOfSizes;
00324 Int_t fDim;
00325 Int_t fVirtDim;
00326 Int_t fPrimaryIndex;
00327 Int_t fSecondaryIndex;
00328
00329 protected:
00330 TFormLeafInfoMultiVarDim(TClass* classptr, Long_t offset,
00331 TStreamerElement* element) : TFormLeafInfo(classptr,offset,element),fNsize(0),fSizes(),fCounter2(0),fSumOfSizes(0),fDim(0),fVirtDim(0),fPrimaryIndex(-1),fSecondaryIndex(-1) {}
00332
00333 public:
00334 TFormLeafInfoMultiVarDim(TClass* classptr, Long_t offset,
00335 TStreamerElement* element, TFormLeafInfo* parent);
00336 TFormLeafInfoMultiVarDim();
00337 TFormLeafInfoMultiVarDim(const TFormLeafInfoMultiVarDim& orig);
00338 ~TFormLeafInfoMultiVarDim();
00339
00340 virtual TFormLeafInfo* DeepCopy() const;
00341
00342
00343
00344
00345
00346
00347
00348 virtual void LoadSizes(TBranch* branch);
00349 virtual Int_t GetPrimaryIndex();
00350 virtual void SetPrimaryIndex(Int_t index);
00351 virtual void SetSecondaryIndex(Int_t index);
00352 virtual void SetSize(Int_t index, Int_t val);
00353 virtual Int_t GetSize(Int_t index);
00354 virtual Int_t GetSumOfSizes();
00355 virtual Double_t GetValue(TLeaf * , Int_t = 0);
00356 virtual Int_t GetVarDim();
00357 virtual Int_t GetVirtVarDim();
00358 virtual Bool_t Update();
00359 virtual void UpdateSizes(TArrayI *garr);
00360 };
00361
00362
00363
00364
00365
00366
00367
00368 class TFormLeafInfoMultiVarDimDirect : public TFormLeafInfoMultiVarDim {
00369 public:
00370 TFormLeafInfoMultiVarDimDirect();
00371 TFormLeafInfoMultiVarDimDirect(const TFormLeafInfoMultiVarDimDirect& orig);
00372
00373 virtual TFormLeafInfo* DeepCopy() const;
00374
00375 virtual Double_t GetValue(TLeaf *leaf, Int_t instance = 0);
00376 virtual Double_t ReadValue(char * , Int_t = 0);
00377 };
00378
00379
00380
00381
00382
00383
00384
00385 class TFormLeafInfoMultiVarDimCollection : public TFormLeafInfoMultiVarDim {
00386 public:
00387 TFormLeafInfoMultiVarDimCollection(TClass* motherclassptr, Long_t offset,
00388 TClass* elementclassptr, TFormLeafInfo *parent);
00389 TFormLeafInfoMultiVarDimCollection(TClass* classptr, Long_t offset,
00390 TStreamerElement* element, TFormLeafInfo* parent);
00391 TFormLeafInfoMultiVarDimCollection();
00392 TFormLeafInfoMultiVarDimCollection(const TFormLeafInfoMultiVarDimCollection& orig);
00393
00394 virtual TFormLeafInfo* DeepCopy() const;
00395
00396 virtual Int_t GetArrayLength() { return 0; }
00397 virtual void LoadSizes(TBranch* branch);
00398 virtual Double_t GetValue(TLeaf *leaf, Int_t instance = 0);
00399 virtual Double_t ReadValue(char * , Int_t = 0);
00400 };
00401
00402
00403
00404
00405
00406
00407
00408 class TFormLeafInfoMultiVarDimClones : public TFormLeafInfoMultiVarDim {
00409 public:
00410 TFormLeafInfoMultiVarDimClones(TClass* motherclassptr, Long_t offset,
00411 TClass* elementclassptr, TFormLeafInfo *parent);
00412 TFormLeafInfoMultiVarDimClones(TClass* classptr, Long_t offset,
00413 TStreamerElement* element, TFormLeafInfo* parent);
00414 TFormLeafInfoMultiVarDimClones();
00415 TFormLeafInfoMultiVarDimClones(const TFormLeafInfoMultiVarDimClones& orig);
00416
00417 virtual TFormLeafInfo* DeepCopy() const;
00418
00419 virtual Int_t GetArrayLength() { return 0; }
00420 virtual void LoadSizes(TBranch* branch);
00421 virtual Double_t GetValue(TLeaf *leaf, Int_t instance = 0);
00422 virtual Double_t ReadValue(char * , Int_t = 0);
00423 };
00424
00425
00426
00427
00428
00429
00430 class TFormLeafInfoCast : public TFormLeafInfo {
00431 public:
00432 TClass *fCasted;
00433 TString fCastedName;
00434 Bool_t fGoodCast;
00435 Bool_t fIsTObject;
00436
00437 TFormLeafInfoCast(TClass* classptr = 0, TClass* casted = 0);
00438 TFormLeafInfoCast(const TFormLeafInfoCast& orig);
00439 virtual ~TFormLeafInfoCast();
00440
00441 virtual TFormLeafInfo* DeepCopy() const;
00442
00443
00444 virtual Int_t GetNdata();
00445 virtual Double_t ReadValue(char *where, Int_t instance = 0);
00446 virtual Bool_t Update();
00447 };
00448
00449
00450
00451
00452
00453
00454 class TFormLeafInfoTTree : public TFormLeafInfo {
00455 TTree *fTree;
00456 TTree *fCurrent;
00457 TString fAlias;
00458
00459 public:
00460 TFormLeafInfoTTree(TTree *tree = 0, const char *alias = 0, TTree *current = 0);
00461 TFormLeafInfoTTree(const TFormLeafInfoTTree& orig);
00462 ~TFormLeafInfoTTree();
00463
00464 virtual TFormLeafInfo* DeepCopy() const;
00465
00466 using TFormLeafInfo::GetLocalValuePointer;
00467 using TFormLeafInfo::GetValue;
00468
00469 virtual void *GetLocalValuePointer(TLeaf *leaf, Int_t instance = 0);
00470 virtual Double_t GetValue(TLeaf *leaf, Int_t instance = 0);
00471 virtual Double_t ReadValue(char *thisobj, Int_t instance);
00472 virtual Bool_t Update();
00473 };
00474
00475
00476 #endif
00477