#include "hcategorysplititer.h" HCategorySplitIter::HCategorySplitIter(void) { } HCategorySplitIter::HCategorySplitIter(HCategorySplit *cat, Bool_t dir) { fCat=cat; Reset(); } HCategorySplitIter::~HCategorySplitIter(void) { } TCollection *HCategorySplitIter::GetCollection(void) const { return fCat->fTableArray; } TObject *HCategorySplitIter::Next(void) { TObject *r=NULL; if (!fFinnished) { r=fCurrentClones->UncheckedAt(fCloneCursor); fCloneCursor++; if (!(fCloneCursorfTableArray->UncheckedAt(fCursor)))==NULL) { fCursor++; if (!(fCursorGetEntriesFast())==0); fCloneCursor=fCloneStart; } } //if (r) printf("Not null\n"); else printf("Null\n"); return r; } void HCategorySplitIter::Reset(void) { fCursor=-1; fCursorEnd=fCat->fTableArray->GetEntriesFast(); fCurrentClones=NULL; fFinnished=kFALSE; do { fCursor++; if (!(fCursorfTableArray->UncheckedAt(fCursor)))==NULL) { fCursor++; if (!fCursorGetEntriesFast())==0); fCursorStart=fCursor; fCloneCursor=fCloneStart=0; } Bool_t HCategorySplitIter::gotoLocation(HLocation &loc) { Int_t i,prod=1; if (loc.getNIndex()==0) { Reset(); } else { fCurrentClones=NULL; fFinnished=kFALSE; fCursor=loc[0]; for(i=1;ifSizesArray.fArray[i]+loc[i]; for(;ifSizesArray.fN;i++) prod*=fCat->fSizesArray.fArray[i]; fCursor*=prod; fCursorEnd=prod+fCursor; fCursor--; do { fCursor++; if (!(fCursorfTableArray->UncheckedAt(fCursor)))==NULL) { fCursor++; if (!fCursorGetEntriesFast())==0); fCursorStart=fCursor; fCloneCursor=fCloneStart=0; } return kTRUE; } HLocation &HCategorySplitIter::getLocation(void) { return fLoc; } ClassImp(HCategorySplitIter)