#ifndef TMidasTripTOldHistoItr_hxx_seen #define TMidasTripTOldHistoItr_hxx_seen // $Id: IMidasTripTOldHistoItr.hxx,v 1.2 2009/09/25 06:02:32 nickwest Exp $ // // The ProHisto class is for the prototype histogram bank used in the first implementation // of the DPT. The ITripTHistoBank and IMidasTripTHisto banks are used for the new // version of the DPT (developed in July 2009, installed a month or two later). #include #include "IMidasItr.hxx" #include "IMidasTripTOldHisto.hxx" namespace COMET { class ITripTOldHistoBank; class IMidasTripTOldHisto; class IMidasTripTOldHistoItr; }; /// The class provides forward iteration over all the TMidasTripTOldHistos in a /// ITripTOldHistoBank. It skips discretely over empty slots in the bank class COMET::IMidasTripTOldHistoItr: public COMET::IMidasItr { public: IMidasTripTOldHistoItr(const COMET::ITripTOldHistoBank* parent); virtual ~IMidasTripTOldHistoItr() {} protected: /// Implement method mandated by IMidasItr. virtual Bool_t EODImp() const { return (fSlotNext == fSlotEOD); } /// Implement method mandated by IMidasItr. virtual IMidasTripTOldHisto GetImp(); /// Implement method mandated by IMidasItr. virtual void RewindImp() { fDataNext = fDataStart; fSlotNext = fSlotStart; }; private: /// The state of this iterator is captured in fSlotNext which /// is the next location in the index. However, the pointer /// fDataNext (which goes between fDataStart and fDataEOD) /// is also held current. const COMET::ITripTOldHistoBank * const fParent; // Ptr to the parent bank const UShort_t * const fPtrStart; /// Ptr to table of the slots in the bank const UChar_t * const fDataStart; /// Ptr to first IMidasTripTOldHisto in data of parent ITripTOldHistoBank. const UChar_t * const fDataEOD; /// Ptr to end of data (= end of the parent ITripTOldHistoBank). const UChar_t *fDataNext; /// Ptr to IMidasTripTOldHisto in data ITripTOldHistoBank returned by next call to GetImp() const UInt_t fSlotStart; /// Index to the slot number we start with UInt_t fSlotNext; /// Index to the slot number next const UInt_t fSlotEOD; /// Last slot number +1 (= number of slots) }; #endif