]>
Commit | Line | Data |
---|---|---|
08edbb90 | 1 | #ifndef TARRAYOFARRAY_H |
2 | #define TARRAYOFARRAY_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | #include "TObject.h" | |
8 | #include "AliObjectArray.h" | |
9 | ||
10 | class TArrayOfArray: public TObject { | |
11 | public: | |
12 | virtual void * At(UInt_t index0, UInt_t index1)=0; | |
13 | //get pointer to the object | |
14 | virtual void Dump(UInt_t index0, UInt_t index1)=0; | |
15 | virtual Int_t Resize(Int_t index, UInt_t newsize)=0; | |
16 | //expand array with index index to newsize | |
17 | virtual UInt_t Push(UInt_t size)=0; | |
18 | //make new array with size - return starting index | |
19 | virtual Int_t ArraySize(UInt_t index)=0; | |
20 | virtual Int_t GetSize()=0; | |
21 | ClassDef(TArrayOfArray,1) | |
22 | }; | |
23 | ||
24 | ||
25 | class TArrayOfArray_vStack: public TArrayOfArray{ | |
26 | public: | |
27 | TArrayOfArray_vStack(); | |
28 | TArrayOfArray_vStack(const char *classname); | |
29 | ~TArrayOfArray_vStack(); | |
30 | Bool_t SetClass(const char * classname); | |
31 | virtual void Clear(Option_t * opt=""); | |
32 | void * Unchecked1DArray(UInt_t index){return fIndex->Unchecked1DAt(index);} | |
33 | void * Unchecked1DAt(UInt_t index0, UInt_t index1); | |
34 | // | |
35 | virtual void * At(UInt_t index0, UInt_t index1); | |
36 | //get pointer to the object | |
37 | virtual void Dump(UInt_t index0, UInt_t index1); | |
38 | virtual Int_t Resize(Int_t index, UInt_t newsize); | |
39 | //expand array with index index to newsize | |
40 | virtual UInt_t Push(UInt_t size); | |
41 | //make new array with size - return starting index | |
42 | virtual Int_t ArraySize(UInt_t index); | |
43 | Int_t ArraySize(){ return fArray->GetSize();} | |
44 | virtual Int_t GetSize(){return (fIndex) ?(Int_t)fIndex->GetSize()-1:0;} | |
45 | private: | |
46 | AliObjectArray * fIndex; | |
47 | AliObjectArray * fArray; | |
48 | ClassDef(TArrayOfArray_vStack,1) | |
49 | }; | |
50 | ||
51 | class TArrayOfArray_vList: public TArrayOfArray{ | |
52 | protected: | |
53 | AliObjectArray fIndex; | |
54 | AliObjectArray fSecondaryIndexes; | |
55 | AliObjectArray fArray; | |
56 | ClassDef(TArrayOfArray_vList,1) | |
57 | }; | |
58 | ||
59 | inline void * TArrayOfArray_vStack::Unchecked1DAt(UInt_t index0, UInt_t index1) | |
60 | { | |
61 | // unchecked return | |
62 | return fArray->Unchecked1DAt(((UInt_t*)fIndex->GetArray())[index0]+index1); | |
63 | } | |
64 | ||
65 | #endif | |
66 | ||
67 |