]> git.uio.no Git - u/mrichter/AliRoot.git/blame - CONTAINERS/TArrayOfArray.h
Added protection in Int_t AliTPCtracker::AliTPCRow::Find(Double_t y) const
[u/mrichter/AliRoot.git] / CONTAINERS / TArrayOfArray.h
CommitLineData
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
10class TArrayOfArray: public TObject {
11public:
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
633d3715 25class TArrayOfArrayVStack: public TArrayOfArray{
08edbb90 26public:
633d3715 27 TArrayOfArrayVStack();
28 TArrayOfArrayVStack(const char *classname);
29 ~TArrayOfArrayVStack();
08edbb90 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;}
45private:
46 AliObjectArray * fIndex;
47 AliObjectArray * fArray;
633d3715 48 ClassDef(TArrayOfArrayVStack,1)
08edbb90 49};
50
633d3715 51class TArrayOfArrayVList: public TArrayOfArray{
08edbb90 52protected:
53 AliObjectArray fIndex;
54 AliObjectArray fSecondaryIndexes;
55 AliObjectArray fArray;
633d3715 56 ClassDef(TArrayOfArrayVList,1)
08edbb90 57};
58
633d3715 59inline void * TArrayOfArrayVStack::Unchecked1DAt(UInt_t index0, UInt_t index1)
08edbb90 60{
61 // unchecked return
62 return fArray->Unchecked1DAt(((UInt_t*)fIndex->GetArray())[index0]+index1);
63}
64
65#endif
66
67