CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

edm::IndexIntoFile::IndexIntoFileItr Class Reference

#include <IndexIntoFile.h>

List of all members.

Public Member Functions

void advanceToEvent ()
void advanceToLumi ()
void advanceToNextLumiOrRun ()
void advanceToNextRun ()
void copyPosition (IndexIntoFileItr const &position)
 Copy the position without modifying the pointer to the IndexIntoFile or size.
EntryNumber_t entry () const
EntryNumber_t firstEventEntryThisLumi () const
EntryNumber_t firstEventEntryThisRun () const
EntryType getEntryType () const
 IndexIntoFileItr (IndexIntoFile const *indexIntoFile, SortOrder sortOrder, EntryType entryType, int indexToRun, int indexToLumi, int indexToEventRange, long long indexToEvent, long long nEvents)
void initializeLumi ()
 Should only be used internally and for tests.
void initializeRun ()
 Should only be used internally and for tests.
LuminosityBlockNumber_t lumi () const
bool operator!= (IndexIntoFileItr const &right) const
IndexIntoFileItroperator++ ()
 Move to next event to be processed.
bool operator== (IndexIntoFileItr const &right) const
EntryNumber_t peekAheadAtEventEntry () const
LuminosityBlockNumber_t peekAheadAtLumi () const
int processHistoryIDIndex () const
RunNumber_t run () const
void skipEventBackward (int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
void skipEventForward (int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
bool skipLumiInRun ()
bool skipToNextEventInLumi ()

Private Member Functions

IndexIntoFile const * indexIntoFile () const
long long indexToEvent () const
int indexToEventRange () const
int indexToLumi () const
int indexToRun () const
long long nEvents () const
int size () const
EntryType type () const

Private Attributes

value_ptr< IndexIntoFileItrImplimpl_

Detailed Description

Definition at line 642 of file IndexIntoFile.h.


Constructor & Destructor Documentation

edm::IndexIntoFile::IndexIntoFileItr::IndexIntoFileItr ( IndexIntoFile const *  indexIntoFile,
SortOrder  sortOrder,
EntryType  entryType,
int  indexToRun,
int  indexToLumi,
int  indexToEventRange,
long long  indexToEvent,
long long  nEvents 
)

This itended to be used only internally and by IndexIntoFile. One thing that is needed for the future, is to add some checks to make sure the iterator is in a valid state inside this constructor. It is currently possible to create an iterator with this constructor in an invalid state and the behavior would then be undefined. In the existing internal usages the iterator will always be valid. (for example IndexIntoFile::begin and IndexIntoFile::findPosition will always return a valid iterator).

Definition at line 1757 of file IndexIntoFile.cc.

References impl_, edm::IndexIntoFile::numericalOrder, edm::swap(), and groupFilesInBlocks::temp.

                                      :
    impl_() {
    if(sortOrder == numericalOrder) {
      value_ptr<IndexIntoFileItrImpl> temp(new IndexIntoFileItrSorted(indexIntoFile,
                                                                      entryType,
                                                                      indexToRun,
                                                                      indexToLumi,
                                                                      indexToEventRange,
                                                                      indexToEvent,
                                                                      nEvents
                                                                     ));
      swap(temp, impl_);
    } else {
      value_ptr<IndexIntoFileItrImpl> temp(new IndexIntoFileItrNoSort(indexIntoFile,
                                                                      entryType,
                                                                      indexToRun,
                                                                      indexToLumi,
                                                                      indexToEventRange,
                                                                      indexToEvent,
                                                                      nEvents));
      swap(temp, impl_);
    }
  }

Member Function Documentation

void edm::IndexIntoFile::IndexIntoFileItr::advanceToEvent ( )

Definition at line 1788 of file IndexIntoFile.cc.

References edm::IndexIntoFile::kEnd, and edm::IndexIntoFile::kEvent.

Referenced by edm::IndexIntoFile::findEventPosition().

                                                     {
    for(EntryType entryType = getEntryType();
        entryType != kEnd && entryType != kEvent;
        entryType = getEntryType()) {
            impl_->next();
    }
  }
void edm::IndexIntoFile::IndexIntoFileItr::advanceToLumi ( )

Definition at line 1796 of file IndexIntoFile.cc.

References edm::IndexIntoFile::kEnd, and edm::IndexIntoFile::kLumi.

Referenced by edm::IndexIntoFile::findLumiPosition().

                                                    {
    for(EntryType entryType = getEntryType();
        entryType != kEnd && entryType != kLumi;
        entryType = getEntryType()) {
            impl_->next();
    }
  }
void edm::IndexIntoFile::IndexIntoFileItr::advanceToNextLumiOrRun ( ) [inline]

Definition at line 738 of file IndexIntoFile.h.

References impl_.

{impl_->advanceToNextLumiOrRun();}
void edm::IndexIntoFile::IndexIntoFileItr::advanceToNextRun ( ) [inline]

Definition at line 737 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::findPosition().

{impl_->advanceToNextRun();}
void edm::IndexIntoFile::IndexIntoFileItr::copyPosition ( IndexIntoFileItr const &  position)

Copy the position without modifying the pointer to the IndexIntoFile or size.

Definition at line 1805 of file IndexIntoFile.cc.

References impl_.

Referenced by edm::RootFile::indexIntoFileIter().

                                                                              {
    impl_->copyPosition(*position.impl_);
  }
EntryNumber_t edm::IndexIntoFile::IndexIntoFileItr::entry ( ) const [inline]

Definition at line 666 of file IndexIntoFile.h.

References impl_.

Referenced by fwlite::EntryFinder::findEvent(), fwlite::EntryFinder::findLumi(), and fwlite::EntryFinder::findRun().

{return impl_->entry();}
EntryNumber_t edm::IndexIntoFile::IndexIntoFileItr::firstEventEntryThisLumi ( ) const [inline]

Definition at line 682 of file IndexIntoFile.h.

References impl_.

Referenced by edm::RootFile::readLuminosityBlockAuxiliary_().

{ return impl_->firstEventEntryThisLumi(); }
EntryNumber_t edm::IndexIntoFile::IndexIntoFileItr::firstEventEntryThisRun ( ) const [inline]

Returns the TTree entry of the first event which would be processed in the current run/lumi if all the events in the run/lumi were processed in the current processing order. If there are none it returns -1 (invalid).

Definition at line 681 of file IndexIntoFile.h.

References impl_.

Referenced by edm::RootFile::readRunAuxiliary_().

{ return impl_->firstEventEntryThisRun(); }
EntryType edm::IndexIntoFile::IndexIntoFileItr::getEntryType ( ) const [inline]
IndexIntoFile const* edm::IndexIntoFile::IndexIntoFileItr::indexIntoFile ( ) const [inline, private]

Definition at line 764 of file IndexIntoFile.h.

References impl_.

{ return impl_->indexIntoFile(); }
long long edm::IndexIntoFile::IndexIntoFileItr::indexToEvent ( ) const [inline, private]

Definition at line 770 of file IndexIntoFile.h.

References impl_.

{ return impl_->indexToEvent(); }
int edm::IndexIntoFile::IndexIntoFileItr::indexToEventRange ( ) const [inline, private]

Definition at line 769 of file IndexIntoFile.h.

References impl_.

{ return impl_->indexToEventRange(); }
int edm::IndexIntoFile::IndexIntoFileItr::indexToLumi ( ) const [inline, private]

Definition at line 768 of file IndexIntoFile.h.

References impl_.

{ return impl_->indexToLumi(); }
int edm::IndexIntoFile::IndexIntoFileItr::indexToRun ( ) const [inline, private]

Definition at line 767 of file IndexIntoFile.h.

References impl_.

{ return impl_->indexToRun(); }
void edm::IndexIntoFile::IndexIntoFileItr::initializeLumi ( ) [inline]

Should only be used internally and for tests.

Definition at line 755 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::findPosition().

{impl_->initializeLumi();}
void edm::IndexIntoFile::IndexIntoFileItr::initializeRun ( ) [inline]

Should only be used internally and for tests.

Definition at line 752 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::begin(), and edm::IndexIntoFile::findPosition().

{impl_->initializeRun();}
LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItr::lumi ( ) const [inline]

Definition at line 665 of file IndexIntoFile.h.

References impl_.

Referenced by edm::RootFile::readLuminosityBlockAuxiliary_().

{return impl_->lumi();}
long long edm::IndexIntoFile::IndexIntoFileItr::nEvents ( ) const [inline, private]

Definition at line 771 of file IndexIntoFile.h.

References impl_.

{ return impl_->nEvents(); }
bool edm::IndexIntoFile::IndexIntoFileItr::operator!= ( IndexIntoFileItr const &  right) const [inline]

Definition at line 747 of file IndexIntoFile.h.

                                                             {
          return !(*this == right);
        }
IndexIntoFileItr& edm::IndexIntoFile::IndexIntoFileItr::operator++ ( void  ) [inline]

Move to next event to be processed.

Definition at line 698 of file IndexIntoFile.h.

References impl_.

                                        {
          impl_->next();
          return *this;
        }
bool edm::IndexIntoFile::IndexIntoFileItr::operator== ( IndexIntoFileItr const &  right) const [inline]

Definition at line 743 of file IndexIntoFile.h.

References impl_.

                                                             {
          return *impl_ == *right.impl_;
        }
EntryNumber_t edm::IndexIntoFile::IndexIntoFileItr::peekAheadAtEventEntry ( ) const [inline]

Same as entry() except when the the current type is kRun or kLumi. In that case instead of always returning -1 (invalid), it will return the event entry that will be processed next and which is in the current run and lumi. If there is none it still returns -1 (invalid).

Definition at line 676 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::findPosition().

{ return impl_->peekAheadAtEventEntry(); }
LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItr::peekAheadAtLumi ( ) const [inline]

Same as lumi() except when the the current type is kRun. In that case instead of always returning 0 (invalid), it will return the lumi that will be processed next

Definition at line 670 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::findPosition().

{ return impl_->peekAheadAtLumi(); }
int edm::IndexIntoFile::IndexIntoFileItr::processHistoryIDIndex ( ) const [inline]

Definition at line 663 of file IndexIntoFile.h.

References impl_.

{return impl_->processHistoryIDIndex();}
RunNumber_t edm::IndexIntoFile::IndexIntoFileItr::run ( ) const [inline]
int edm::IndexIntoFile::IndexIntoFileItr::size ( void  ) const [inline, private]

Definition at line 765 of file IndexIntoFile.h.

References impl_.

{ return impl_->size(); }
void edm::IndexIntoFile::IndexIntoFileItr::skipEventBackward ( int &  phIndexOfEvent,
RunNumber_t runOfEvent,
LuminosityBlockNumber_t lumiOfEvent,
EntryNumber_t eventEntry 
) [inline]

Move so that the event immediately preceding the the current position is the next event processed. If the type is kEvent or kLumi, then change the type to kRun if and only if the preceding event is in a different run. If the type is kEvent, change the type to kLumi if the lumi is different but the run is the same. Otherwise leave the type unchanged.

Definition at line 722 of file IndexIntoFile.h.

References impl_.

                                                          {
          impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
        }
void edm::IndexIntoFile::IndexIntoFileItr::skipEventForward ( int &  phIndexOfSkippedEvent,
RunNumber_t runOfSkippedEvent,
LuminosityBlockNumber_t lumiOfSkippedEvent,
EntryNumber_t skippedEventEntry 
) [inline]

Move to whatever is immediately after the current event or after the next event if there is not a current event, but do not modify the type or run/lumi indexes unless it is necessary because there are no more events in the current run or lumi.

Definition at line 708 of file IndexIntoFile.h.

References impl_.

                                                                {
          impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
        }
bool edm::IndexIntoFile::IndexIntoFileItr::skipLumiInRun ( ) [inline]

Move to the next lumi in the current run. Returns false if there is not one.

Definition at line 731 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::findPosition().

{ return impl_->skipLumiInRun(); }
bool edm::IndexIntoFile::IndexIntoFileItr::skipToNextEventInLumi ( ) [inline]

Move to the next event in the current lumi. Returns false if there is not one.

Definition at line 735 of file IndexIntoFile.h.

References impl_.

Referenced by edm::IndexIntoFile::findPosition().

{ return impl_->skipToNextEventInLumi(); }
EntryType edm::IndexIntoFile::IndexIntoFileItr::type ( ) const [inline, private]

Definition at line 766 of file IndexIntoFile.h.

References impl_.

{ return impl_->type(); }

Member Data Documentation