ROOT logo
ROOT » CORE » CONT » TArrayI

class TArrayI: public TArray


TArrayI

Array of integers (32 bits per element).


Function Members (Methods)

public:
TArrayI()
TArrayI(Int_t n)
TArrayI(const TArrayI& array)
TArrayI(Int_t n, const Int_t* array)
virtual~TArrayI()
voidAddAt(Int_t c, Int_t i)
voidAdopt(Int_t n, Int_t* array)
Int_tAt(Int_t i) const
static TClass*Class()
voidCopy(TArrayI& array) const
const Int_t*GetArray() const
Int_t*GetArray()
virtual Double_tGetAt(Int_t i) const
Int_tTArray::GetSize() const
Stat_tGetSum() const
virtual TClass*IsA() const
TArrayI&operator=(const TArrayI& rhs)
Int_t&operator[](Int_t i)
Int_toperator[](Int_t i) const
static TArray*TArray::ReadArray(TBuffer& b, const TClass* clReq)
voidReset()
voidReset(Int_t val)
virtual voidSet(Int_t n)
voidSet(Int_t n, const Int_t* array)
virtual voidSetAt(Double_t v, Int_t i)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
static voidTArray::WriteArray(TBuffer& b, const TArray* a)
protected:
Bool_tTArray::BoundsOk(const char* where, Int_t at) const
Bool_tTArray::OutOfBoundsError(const char* where, Int_t i) const

Data Members

public:
Int_t*fArray[fN] Array of fN 32 bit integers
Int_tTArray::fNNumber of array elements

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TArrayI()
 Default TArrayI ctor.
TArrayI(Int_t n)
 Create TArrayI object and set array size to n integers.
TArrayI(Int_t n, const Int_t* array)
 Create TArrayI object and initialize it with values of array.
TArrayI(const TArrayI &array)
 Copy constructor.
TArrayI & operator=(const TArrayI& rhs)
 TArrayI assignment operator.
~TArrayI()
 Delete TArrayI object.
void Adopt(Int_t n, Int_t* array)
 Adopt array arr into TArrayI, i.e. don't copy arr but use it directly
 in TArrayI. User may not delete arr, TArrayI dtor will do it.
void AddAt(Int_t c, Int_t i)
 Add Int_t c at position i. Check for out of bounds.
void Set(Int_t n)
 Set size of this array to n ints.
 A new array is created, the old contents copied to the new array,
 then the old array is deleted.
 This function should not be called if the array was declared via Adopt.
void Set(Int_t n, const Int_t* array)
 Set size of this array to n ints and set the contents.
 This function should not be called if the array was declared via Adopt.
void Streamer(TBuffer& b)
 Stream a TArrayI object.
Int_t At(Int_t i) const
Int_t & operator[](Int_t i)
Int_t operator[](Int_t i)
void Copy(TArrayI& array) const
{array.Set(fN,fArray);}
const Int_t * GetArray()
{ return fArray; }
Int_t * GetArray()
{ return fArray; }
Double_t GetAt(Int_t i) const
{ return At(i); }
Stat_t GetSum() const
{Stat_t sum=0; for (Int_t i=0;i<fN;i++) sum+=fArray[i]; return sum;}
void Reset()
{memset(fArray, 0, fN*sizeof(Int_t));}
void Reset(Int_t val)
{for (Int_t i=0;i<fN;i++) fArray[i] = val;}
void SetAt(Double_t v, Int_t i)
{ AddAt((Int_t)v, i); }