#include "hlinearcatiter.h"
#include "hlinearcategory.h"
#include "TClass.h"
#include "TClonesArray.h"
#include "TIterator.h"
HLinearCatIter::HLinearCatIter(void) {
}
HLinearCatIter::HLinearCatIter(HLinearCategory *cat,Bool_t dir) {
fArray=cat->fData;
fDir=dir;
fCurrentLoc.set(1,0);
fIterator=fArray->MakeIterator(dir);
fLocated=fLast=kFALSE;
}
HLinearCatIter::~HLinearCatIter(void) {
if (fIterator) delete fIterator;
}
TCollection *HLinearCatIter::GetCollection(void) const {
return fArray;
}
TObject *HLinearCatIter::Next(void) {
if (fLocated && fLast) {
fCurrent=NULL;
} else {
fCurrent=fIterator->Next();
fLast=kTRUE;
}
return fCurrent;
}
void HLinearCatIter::Reset(void) {
fLocated=fLast=kFALSE;
fIterator->Reset();
}
Bool_t HLinearCatIter::gotoLocation(HLocation &loc) {
if (loc.getNIndex()==0) {
Reset();
} else {
fLocated=kTRUE; fLast=kFALSE;
fCurrent=fArray->At(loc[0]);
if (!fCurrent) return kFALSE;
}
return kTRUE;
}
HLocation &HLinearCatIter::getLocation(void) {
fCurrentLoc[0]=fArray->IndexOf(fCurrent);
return fCurrentLoc;
}
ClassImp(HLinearCatIter)
Last change: Sat May 22 12:58:56 2010
Last generated: 2010-05-22 12:58
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.