#include "hclonestable.h"
#include "TArrayI.h"
HClonesTable::HClonesTable(void) {
}
HClonesTable::HClonesTable(Text_t *className,Int_t capacity,Int_t size,
Int_t callDtor) :
TClonesArray(className,size,callDtor), fTable(capacity),fNObjects(0) {
Int_t i;
for (i=0;i<capacity;i++) fTable[i]=-1;
}
HClonesTable::~HClonesTable(void) {
fNObjects=0;
}
void HClonesTable::Clear(Option_t *) {
Int_t i;
TClonesArray::Clear();
for (i=0;i<fTable.fN;i++) fTable.fArray[i]=-1;
fNObjects=0;
}
void HClonesTable::Delete(Option_t *) {
Int_t i;
TClonesArray::Delete();
for (i=0;i<fTable.fN;i++) fTable.fArray[i]=-1;
fNObjects=0;
}
TObject* HClonesTable::RemoveAt(Int_t idx) {
if (fTable[idx]>-1) {
TObject* out= TClonesArray::RemoveAt(fTable.fArray[idx]);
fTable.fArray[idx]=-1;
return out;
}
return 0;
}
TObject *HClonesTable::Remove(TObject *) {
Warning("HClonesTable::Remove","Not yet implemented");
return NULL;
}
void HClonesTable::Sort(Int_t) {
Warning("HClonesTable::Sort","not yet implemented");
}
TObject *&HClonesTable::operator[](Int_t idx) {
Int_t n;
if (fTable[idx]>-1) n=fTable[idx];
else {n=fNObjects++; fTable[idx]=n;}
return TClonesArray::operator[](n);
}
TObject *HClonesTable::At(Int_t idx) {
if (idx<fTable.fN) {
return (fTable.fArray[idx]>-1)?(TClonesArray::UncheckedAt(fTable.fArray[idx])):((TObject *)NULL);
} else return NULL;
}
void HClonesTable::Compress(void) {
Warning("HClonesTable::Compress","not yet implemented");
}
ClassImp(HClonesTable)
Last change: Sat May 22 12:53:50 2010
Last generated: 2010-05-22 12:53
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.