ROOT
6.12/07
Reference Guide
tree
tree
inc
TIndArray.h
Go to the documentation of this file.
1
// @(#)root/tree:$Id$
2
// Author: Lukasz Janyst <ljanyst@cern.ch> 23/01/2008
3
4
//------------------------------------------------------------------------------
5
// file: TIndArray.h
6
//------------------------------------------------------------------------------
7
8
#ifndef ROOT_TIndArray
9
#define ROOT_TIndArray
10
11
#include "
Rtypes.h
"
12
13
14
class
TIndArray
15
{
16
public
:
17
TIndArray
():
18
fElems
( 0 ),
fCapacity
( 0 ),
fArr
( 0 ) {};
19
20
virtual
~TIndArray
()
21
{
22
delete
[]
fArr
;
23
}
24
25
void
ClearAndResize
(
UInt_t
size )
26
{
27
delete
[]
fArr
;
28
fElems
= 0;
29
fArr
=
new
UChar_t
[size];
30
fCapacity
= size;
31
}
32
33
UInt_t
GetCapacity
() {
return
fCapacity
; }
34
UInt_t
GetNumItems
() {
return
fElems
; }
35
void
SetNumItems
(
UInt_t
items ) {
fElems
= items;}
36
UChar_t
&
At
(
Int_t
ind ) {
return
fArr
[ind]; }
37
void
Clear
() {
fElems
= 0; }
38
39
private
:
40
UInt_t
fElems
;
///< Number of elements stored in the array
41
UInt_t
fCapacity
;
///<! Capacity of the array
42
UChar_t
*
fArr
;
///<[fElems] The array
43
44
};
45
46
#endif // ROOT_TIndArray
TIndArray::fArr
UChar_t * fArr
[fElems] The array
Definition:
TIndArray.h:42
Rtypes.h
TIndArray::At
UChar_t & At(Int_t ind)
Definition:
TIndArray.h:36
TIndArray
Definition:
TIndArray.h:14
Int_t
int Int_t
Definition:
RtypesCore.h:41
TIndArray::fCapacity
UInt_t fCapacity
! Capacity of the array
Definition:
TIndArray.h:41
TIndArray::GetCapacity
UInt_t GetCapacity()
Definition:
TIndArray.h:33
TIndArray::TIndArray
TIndArray()
Definition:
TIndArray.h:17
TIndArray::Clear
void Clear()
Definition:
TIndArray.h:37
TIndArray::ClearAndResize
void ClearAndResize(UInt_t size)
Definition:
TIndArray.h:25
TIndArray::GetNumItems
UInt_t GetNumItems()
Definition:
TIndArray.h:34
UInt_t
unsigned int UInt_t
Definition:
RtypesCore.h:42
TIndArray::SetNumItems
void SetNumItems(UInt_t items)
Definition:
TIndArray.h:35
TIndArray::fElems
UInt_t fElems
Number of elements stored in the array.
Definition:
TIndArray.h:40
TIndArray::~TIndArray
virtual ~TIndArray()
Definition:
TIndArray.h:20
UChar_t
unsigned char UChar_t
Definition:
RtypesCore.h:34