ROOT logo
// @(#)root/tree:$Id$
// Author:  Lukasz Janyst <ljanyst@cern.ch> 23/01/2008

//------------------------------------------------------------------------------
// file:   TIndArray.h
//------------------------------------------------------------------------------

#ifndef ROOT_TIndArray
#define ROOT_TIndArray

#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif


class TIndArray
{
   public:
      TIndArray():
         fElems( 0 ), fCapacity( 0 ), fArr( 0 ) {};

      virtual ~TIndArray()
      {
         delete [] fArr;
      }

      void ClearAndResize( UInt_t size )
      {
         delete [] fArr;
         fElems = 0;
         fArr = new UChar_t[size];
         fCapacity = size;
      }

      UInt_t   GetCapacity() { return fCapacity; }
      UInt_t   GetNumItems() { return fElems; }
      void     SetNumItems( UInt_t items ) { fElems = items;}
      UChar_t &At( Int_t ind ) { return fArr[ind]; }
      void     Clear() { fElems = 0; }

   private:
      UInt_t   fElems;     // Number of elements stored in the array
      UInt_t   fCapacity;  //!Capacity of the array
      UChar_t *fArr;       //[fElems] The array

};

#endif // ROOT_TIndArray
 TIndArray.h:1
 TIndArray.h:2
 TIndArray.h:3
 TIndArray.h:4
 TIndArray.h:5
 TIndArray.h:6
 TIndArray.h:7
 TIndArray.h:8
 TIndArray.h:9
 TIndArray.h:10
 TIndArray.h:11
 TIndArray.h:12
 TIndArray.h:13
 TIndArray.h:14
 TIndArray.h:15
 TIndArray.h:16
 TIndArray.h:17
 TIndArray.h:18
 TIndArray.h:19
 TIndArray.h:20
 TIndArray.h:21
 TIndArray.h:22
 TIndArray.h:23
 TIndArray.h:24
 TIndArray.h:25
 TIndArray.h:26
 TIndArray.h:27
 TIndArray.h:28
 TIndArray.h:29
 TIndArray.h:30
 TIndArray.h:31
 TIndArray.h:32
 TIndArray.h:33
 TIndArray.h:34
 TIndArray.h:35
 TIndArray.h:36
 TIndArray.h:37
 TIndArray.h:38
 TIndArray.h:39
 TIndArray.h:40
 TIndArray.h:41
 TIndArray.h:42
 TIndArray.h:43
 TIndArray.h:44
 TIndArray.h:45
 TIndArray.h:46
 TIndArray.h:47
 TIndArray.h:48