CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
edm::IndexIntoFile::IndexIntoFileItr Class Reference

#include <IndexIntoFile.h>

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. More...
 
EntryNumber_t entry () const
 
EntryNumber_t firstEventEntryThisLumi ()
 
EntryNumber_t firstEventEntryThisRun ()
 
EntryType getEntryType () const
 
void getLumisInRun (std::vector< LuminosityBlockNumber_t > &lumis) 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. More...
 
void initializeRun ()
 Should only be used internally and for tests. More...
 
LuminosityBlockNumber_t lumi () const
 
bool operator!= (IndexIntoFileItr const &right) const
 
IndexIntoFileItroperator++ ()
 Move to next event to be processed. More...
 
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_
 

Friends

class ::TestIndexIntoFile
 
class ::TestIndexIntoFile3
 
class ::TestIndexIntoFile4
 
class ::TestIndexIntoFile5
 

Detailed Description

Definition at line 698 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 1836 of file IndexIntoFile.cc.

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

1843  :
1844  impl_() {
1845  if(sortOrder == numericalOrder) {
1846  value_ptr<IndexIntoFileItrImpl> temp(new IndexIntoFileItrSorted(indexIntoFile,
1847  entryType,
1848  indexToRun,
1849  indexToLumi,
1851  indexToEvent,
1852  nEvents
1853  ));
1854  swap(temp, impl_);
1855  } else {
1856  value_ptr<IndexIntoFileItrImpl> temp(new IndexIntoFileItrNoSort(indexIntoFile,
1857  entryType,
1858  indexToRun,
1859  indexToLumi,
1861  indexToEvent,
1862  nEvents));
1863  swap(temp, impl_);
1864  }
1865  }
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
IndexIntoFile const * indexIntoFile() const
value_ptr< IndexIntoFileItrImpl > impl_

Member Function Documentation

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

Definition at line 1867 of file IndexIntoFile.cc.

References getEntryType(), impl_, edm::IndexIntoFile::kEnd, and edm::IndexIntoFile::kEvent.

Referenced by edm::IndexIntoFile::findEventPosition(), edm::RootFile::setEntryAtNextEventInLumi(), and edm::RootFile::wasLastEventJustRead().

1867  {
1868  for(EntryType entryType = getEntryType();
1869  entryType != kEnd && entryType != kEvent;
1870  entryType = getEntryType()) {
1871  impl_->next();
1872  }
1873  }
value_ptr< IndexIntoFileItrImpl > impl_
void edm::IndexIntoFile::IndexIntoFileItr::advanceToLumi ( )

Definition at line 1875 of file IndexIntoFile.cc.

References getEntryType(), impl_, edm::IndexIntoFile::kEnd, and edm::IndexIntoFile::kLumi.

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

1875  {
1876  for(EntryType entryType = getEntryType();
1877  entryType != kEnd && entryType != kLumi;
1878  entryType = getEntryType()) {
1879  impl_->next();
1880  }
1881  }
value_ptr< IndexIntoFileItrImpl > impl_
void edm::IndexIntoFile::IndexIntoFileItr::advanceToNextLumiOrRun ( )
inline

Definition at line 794 of file IndexIntoFile.h.

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

794 {impl_->advanceToNextLumiOrRun();}
value_ptr< IndexIntoFileItrImpl > impl_
void edm::IndexIntoFile::IndexIntoFileItr::advanceToNextRun ( )
inline

Definition at line 793 of file IndexIntoFile.h.

Referenced by edm::IndexIntoFile::findPosition(), and edm::RootFile::getNextItemType().

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

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

Definition at line 1884 of file IndexIntoFile.cc.

References impl_.

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

1884  {
1885  impl_->copyPosition(*position.impl_);
1886  }
static int position[264][3]
Definition: ReadPGInfo.cc:509
value_ptr< IndexIntoFileItrImpl > impl_
EntryNumber_t edm::IndexIntoFile::IndexIntoFileItr::entry ( ) const
inline
EntryNumber_t edm::IndexIntoFile::IndexIntoFileItr::firstEventEntryThisLumi ( )
inline

Definition at line 738 of file IndexIntoFile.h.

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

738 { return impl_->firstEventEntryThisLumi(); }
value_ptr< IndexIntoFileItrImpl > impl_
EntryNumber_t edm::IndexIntoFile::IndexIntoFileItr::firstEventEntryThisRun ( )
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 737 of file IndexIntoFile.h.

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

737 { return impl_->firstEventEntryThisRun(); }
value_ptr< IndexIntoFileItrImpl > impl_
EntryType edm::IndexIntoFile::IndexIntoFileItr::getEntryType ( ) const
inline
void edm::IndexIntoFile::IndexIntoFileItr::getLumisInRun ( std::vector< LuminosityBlockNumber_t > &  lumis) const
inline

Definition at line 816 of file IndexIntoFile.h.

816 {impl_->getLumisInRun(lumis);}
value_ptr< IndexIntoFileItrImpl > impl_
IndexIntoFile const* edm::IndexIntoFile::IndexIntoFileItr::indexIntoFile ( ) const
inlineprivate

Definition at line 827 of file IndexIntoFile.h.

827 { return impl_->indexIntoFile(); }
value_ptr< IndexIntoFileItrImpl > impl_
long long edm::IndexIntoFile::IndexIntoFileItr::indexToEvent ( ) const
inlineprivate

Definition at line 833 of file IndexIntoFile.h.

833 { return impl_->indexToEvent(); }
value_ptr< IndexIntoFileItrImpl > impl_
int edm::IndexIntoFile::IndexIntoFileItr::indexToEventRange ( ) const
inlineprivate

Definition at line 832 of file IndexIntoFile.h.

832 { return impl_->indexToEventRange(); }
value_ptr< IndexIntoFileItrImpl > impl_
int edm::IndexIntoFile::IndexIntoFileItr::indexToLumi ( ) const
inlineprivate

Definition at line 831 of file IndexIntoFile.h.

831 { return impl_->indexToLumi(); }
value_ptr< IndexIntoFileItrImpl > impl_
int edm::IndexIntoFile::IndexIntoFileItr::indexToRun ( ) const
inlineprivate

Definition at line 830 of file IndexIntoFile.h.

830 { return impl_->indexToRun(); }
value_ptr< IndexIntoFileItrImpl > impl_
void edm::IndexIntoFile::IndexIntoFileItr::initializeLumi ( )
inline

Should only be used internally and for tests.

Definition at line 811 of file IndexIntoFile.h.

References position.

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

811 {impl_->initializeLumi();}
value_ptr< IndexIntoFileItrImpl > impl_
void edm::IndexIntoFile::IndexIntoFileItr::initializeRun ( )
inline

Should only be used internally and for tests.

Definition at line 808 of file IndexIntoFile.h.

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

808 {impl_->initializeRun();}
value_ptr< IndexIntoFileItrImpl > impl_
LuminosityBlockNumber_t edm::IndexIntoFile::IndexIntoFileItr::lumi ( ) const
inline
long long edm::IndexIntoFile::IndexIntoFileItr::nEvents ( ) const
inlineprivate

Definition at line 834 of file IndexIntoFile.h.

834 { return impl_->nEvents(); }
value_ptr< IndexIntoFileItrImpl > impl_
bool edm::IndexIntoFile::IndexIntoFileItr::operator!= ( IndexIntoFileItr const &  right) const
inline

Definition at line 803 of file IndexIntoFile.h.

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

Move to next event to be processed.

Definition at line 754 of file IndexIntoFile.h.

754  {
755  impl_->next();
756  return *this;
757  }
value_ptr< IndexIntoFileItrImpl > impl_
bool edm::IndexIntoFile::IndexIntoFileItr::operator== ( IndexIntoFileItr const &  right) const
inline

Definition at line 799 of file IndexIntoFile.h.

References impl_.

799  {
800  return *impl_ == *right.impl_;
801  }
value_ptr< IndexIntoFileItrImpl > 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 732 of file IndexIntoFile.h.

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

732 { return impl_->peekAheadAtEventEntry(); }
value_ptr< IndexIntoFileItrImpl > impl_
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 726 of file IndexIntoFile.h.

Referenced by edm::IndexIntoFile::findPosition(), and edm::RootFile::skipThisEntry().

726 { return impl_->peekAheadAtLumi(); }
value_ptr< IndexIntoFileItrImpl > impl_
int edm::IndexIntoFile::IndexIntoFileItr::processHistoryIDIndex ( ) const
inline

Definition at line 719 of file IndexIntoFile.h.

Referenced by edm::RootFile::isDuplicateEvent(), and edm::RootFile::readEvent().

719 {return impl_->processHistoryIDIndex();}
value_ptr< IndexIntoFileItrImpl > impl_
RunNumber_t edm::IndexIntoFile::IndexIntoFileItr::run ( ) const
inline
int edm::IndexIntoFile::IndexIntoFileItr::size ( void  ) const
inlineprivate

Definition at line 828 of file IndexIntoFile.h.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

828 { return impl_->size(); }
value_ptr< IndexIntoFileItrImpl > impl_
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 778 of file IndexIntoFile.h.

Referenced by edm::RootFile::skipEvents(), and edm::RootFile::wasFirstEventJustRead().

781  {
782  impl_->skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
783  }
value_ptr< IndexIntoFileItrImpl > impl_
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 764 of file IndexIntoFile.h.

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

767  {
768  impl_->skipEventForward(phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
769  }
value_ptr< IndexIntoFileItrImpl > impl_
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 787 of file IndexIntoFile.h.

Referenced by edm::IndexIntoFile::findPosition(), and edm::RootFile::skipThisEntry().

787 { return impl_->skipLumiInRun(); }
value_ptr< IndexIntoFileItrImpl > impl_
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 791 of file IndexIntoFile.h.

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

791 { return impl_->skipToNextEventInLumi(); }
value_ptr< IndexIntoFileItrImpl > impl_
EntryType edm::IndexIntoFile::IndexIntoFileItr::type ( ) const
inlineprivate

Friends And Related Function Documentation

friend class ::TestIndexIntoFile
friend

Definition at line 820 of file IndexIntoFile.h.

friend class ::TestIndexIntoFile3
friend

Definition at line 821 of file IndexIntoFile.h.

friend class ::TestIndexIntoFile4
friend

Definition at line 822 of file IndexIntoFile.h.

friend class ::TestIndexIntoFile5
friend

Definition at line 823 of file IndexIntoFile.h.

Member Data Documentation

value_ptr<IndexIntoFileItrImpl> edm::IndexIntoFile::IndexIntoFileItr::impl_
private