#include <FileIndex.h>
Definition at line 20 of file FileIndex.h.
typedef std::vector<Element>::const_iterator edm::FileIndex::const_iterator |
Definition at line 53 of file FileIndex.h.
typedef long long edm::FileIndex::EntryNumber_t |
Definition at line 23 of file FileIndex.h.
typedef std::vector<Element>::iterator edm::FileIndex::iterator |
Definition at line 55 of file FileIndex.h.
Definition at line 116 of file FileIndex.h.
edm::FileIndex::FileIndex | ( | ) |
Definition at line 10 of file FileIndex.cc.
: entries_(), transients_() {}
edm::FileIndex::~FileIndex | ( | ) | [inline] |
Definition at line 26 of file FileIndex.h.
{}
void edm::FileIndex::addEntry | ( | RunNumber_t | run, |
LuminosityBlockNumber_t | lumi, | ||
EventNumber_t | event, | ||
EntryNumber_t | entry | ||
) |
Definition at line 22 of file FileIndex.cc.
References entries_, kNotSorted, resultCached(), and sortState().
{ entries_.push_back(FileIndex::Element(run, lumi, event, entry)); resultCached() = false; sortState() = kNotSorted; }
bool edm::FileIndex::allEventsInEntryOrder | ( | ) | const |
Definition at line 40 of file FileIndex.cc.
References allInEntryOrder(), entries_, edm::FileIndex::Element::invalidEntry, kEvent, and resultCached().
{ if(!resultCached()) { resultCached() = true; EntryNumber_t maxEntry = Element::invalidEntry; for(std::vector<FileIndex::Element>::const_iterator it = entries_.begin(), itEnd = entries_.end(); it != itEnd; ++it) { if(it->getEntryType() == kEvent) { if(it->entry_ < maxEntry) { allInEntryOrder() = false; return false; } maxEntry = it->entry_; } } allInEntryOrder() = true; return true; } return allInEntryOrder(); }
bool& edm::FileIndex::allInEntryOrder | ( | ) | const [inline, private] |
Definition at line 127 of file FileIndex.h.
References edm::Transient< T >::get(), and transients_.
Referenced by allEventsInEntryOrder().
{return transients_.get().allInEntryOrder_;}
iterator edm::FileIndex::begin | ( | void | ) | [inline] |
const_iterator edm::FileIndex::begin | ( | void | ) | const [inline] |
Definition at line 98 of file FileIndex.h.
References entries_.
Referenced by edm::operator<<().
{return entries_.begin();}
bool edm::FileIndex::containsEvent | ( | RunNumber_t | run, |
LuminosityBlockNumber_t | lumi, | ||
EventNumber_t | event | ||
) | const [inline] |
Definition at line 84 of file FileIndex.h.
References entries_, and findEventPosition().
Referenced by containsItem().
{ return findEventPosition(run, lumi, event) != entries_.end(); }
bool edm::FileIndex::containsItem | ( | RunNumber_t | run, |
LuminosityBlockNumber_t | lumi, | ||
EventNumber_t | event | ||
) | const [inline] |
Definition at line 79 of file FileIndex.h.
References containsEvent(), containsLumi(), and containsRun().
{ return event ? containsEvent(run, lumi, event) : (lumi ? containsLumi(run, lumi) : containsRun(run)); }
bool edm::FileIndex::containsLumi | ( | RunNumber_t | run, |
LuminosityBlockNumber_t | lumi | ||
) | const [inline] |
Definition at line 89 of file FileIndex.h.
References entries_, and findLumiPosition().
Referenced by containsItem().
{ return findLumiPosition(run, lumi) != entries_.end(); }
bool edm::FileIndex::containsRun | ( | RunNumber_t | run | ) | const [inline] |
Definition at line 94 of file FileIndex.h.
References entries_, and findRunPosition().
Referenced by containsItem().
{ return findRunPosition(run) != entries_.end(); }
bool edm::FileIndex::empty | ( | ) | const [inline] |
Definition at line 112 of file FileIndex.h.
References entries_.
Referenced by fwlite::EntryFinder::empty().
{return entries_.empty();}
iterator edm::FileIndex::end | ( | void | ) | [inline] |
const_iterator edm::FileIndex::end | ( | void | ) | const [inline] |
Definition at line 100 of file FileIndex.h.
References entries_.
Referenced by fwlite::EntryFinder::findEvent(), fwlite::EntryFinder::findLumi(), fwlite::EntryFinder::findRun(), and edm::operator<<().
{return entries_.end();}
FileIndex::const_iterator edm::FileIndex::findEventEntryPosition | ( | RunNumber_t | run, |
LuminosityBlockNumber_t | lumi, | ||
EventNumber_t | event, | ||
EntryNumber_t | entry | ||
) | const |
Definition at line 156 of file FileIndex.cc.
References entries_, findEventPosition(), kNotSorted, kSorted_Run_Lumi_EventEntry, edm::lower_bound_all(), and sortState().
{ assert(sortState() != kNotSorted); const_iterator it; const_iterator itEnd = entries_.end(); if(sortState() == kSorted_Run_Lumi_EventEntry) { assert(lumi != 0U); Element el(run, lumi, event, entry); it = lower_bound_all(entries_, el, Compare_Run_Lumi_EventEntry()); } else { it = findEventPosition(run, lumi, event); while(it != itEnd && it->entry_ != entry && it->event_ == event) { ++it; } } if(it == itEnd) return itEnd; if(lumi == 0) lumi = it->lumi_; if(it->run_ != run || it->lumi_ != lumi || it->event_ != event || it->entry_ != entry) return itEnd; return it; }
FileIndex::const_iterator edm::FileIndex::findEventPosition | ( | RunNumber_t | run, |
LuminosityBlockNumber_t | lumi, | ||
EventNumber_t | event | ||
) | const |
Definition at line 85 of file FileIndex.cc.
References entries_, findPosition(), kEvent, kSorted_Run_Lumi_Event, and sortState().
Referenced by containsEvent(), fwlite::EntryFinder::findEvent(), and findEventEntryPosition().
{ const_iterator it = findPosition(run, lumi, event); const_iterator itEnd = entries_.end(); while(it != itEnd && it->getEntryType() != FileIndex::kEvent) { ++it; } if(it == itEnd) { return itEnd; } if(lumi == 0) { lumi = it->lumi_; } if(it->run_ != run || it->lumi_ != lumi || it->event_ != event) { if (sortState() == kSorted_Run_Lumi_Event) { return itEnd; } // not sorted by event, so we need to do a linear search while (it != itEnd && it->run_ == run && it->lumi_ == lumi && it->event_ != event) { ++it; } if(it->run_ != run || it->lumi_ != lumi || it->event_ != event) { return itEnd; } } return it; }
FileIndex::const_iterator edm::FileIndex::findLumiOrRunPosition | ( | RunNumber_t | run, |
LuminosityBlockNumber_t | lumi | ||
) | const |
Definition at line 146 of file FileIndex.cc.
References entries_, findPosition(), kLumi, and kRun.
{ const_iterator it = findPosition(run, lumi, 0U); const_iterator itEnd = entries_.end(); while(it != itEnd && it->getEntryType() != FileIndex::kLumi && it->getEntryType() != FileIndex::kRun) { ++it; } return it; }
FileIndex::const_iterator edm::FileIndex::findLumiPosition | ( | RunNumber_t | run, |
LuminosityBlockNumber_t | lumi | ||
) | const |
Definition at line 114 of file FileIndex.cc.
References entries_, findPosition(), and kLumi.
Referenced by containsLumi(), and fwlite::EntryFinder::findLumi().
{ const_iterator it = findPosition(run, lumi, 0U); const_iterator itEnd = entries_.end(); while(it != itEnd && it->getEntryType() != FileIndex::kLumi) { ++it; } if(it == itEnd) { return itEnd; } if(it->run_ != run || it->lumi_ != lumi) { return itEnd; } return it; }
FileIndex::const_iterator edm::FileIndex::findPosition | ( | RunNumber_t | run, |
LuminosityBlockNumber_t | lumi = 0U , |
||
EventNumber_t | event = 0U |
||
) | const |
Definition at line 60 of file FileIndex.cc.
References entries_, kNotSorted, kSorted_Run_Lumi_Event, edm::lower_bound_all(), and sortState().
Referenced by findEventPosition(), findLumiOrRunPosition(), findLumiPosition(), and findRunPosition().
{ assert(sortState() != kNotSorted); const_iterator itEnd = entries_.end(); const_iterator it; Element el(run, lumi, event); if (sortState() == kSorted_Run_Lumi_Event) { it = lower_bound_all(entries_, el); bool lumiMissing = (lumi == 0 && event != 0); if(lumiMissing) { while(it != itEnd && it->run_ < run) { ++it; } while(it != itEnd && (it->run_ == run && it->event_ < event)) { ++it; } } } else { it = lower_bound_all(entries_, el, Compare_Run_Lumi_EventEntry()); } return it; }
FileIndex::const_iterator edm::FileIndex::findRunPosition | ( | RunNumber_t | run | ) | const |
Definition at line 130 of file FileIndex.cc.
References entries_, findPosition(), and kRun.
Referenced by containsRun(), and fwlite::EntryFinder::findRun().
{ const_iterator it = findPosition(run, 0U, 0U); const_iterator itEnd = entries_.end(); while(it != itEnd && it->getEntryType() != FileIndex::kRun) { ++it; } if(it == itEnd) { return itEnd; } if(it->run_ != run) { return itEnd; } return it; }
bool& edm::FileIndex::resultCached | ( | ) | const [inline, private] |
Definition at line 128 of file FileIndex.h.
References edm::Transient< T >::get(), and transients_.
Referenced by addEntry(), allEventsInEntryOrder(), sortBy_Run_Lumi_Event(), and sortBy_Run_Lumi_EventEntry().
{return transients_.get().resultCached_;}
std::vector<Element>::size_type edm::FileIndex::size | ( | void | ) | const [inline] |
void edm::FileIndex::sortBy_Run_Lumi_Event | ( | ) |
Definition at line 28 of file FileIndex.cc.
References entries_, kSorted_Run_Lumi_Event, resultCached(), sortState(), and edm::stable_sort_all().
{ stable_sort_all(entries_); resultCached() = false; sortState() = kSorted_Run_Lumi_Event; }
void edm::FileIndex::sortBy_Run_Lumi_EventEntry | ( | ) |
Definition at line 34 of file FileIndex.cc.
References entries_, kSorted_Run_Lumi_EventEntry, resultCached(), sortState(), and edm::stable_sort_all().
{ stable_sort_all(entries_, Compare_Run_Lumi_EventEntry()); resultCached() = false; sortState() = kSorted_Run_Lumi_EventEntry; }
SortState& edm::FileIndex::sortState | ( | ) | const [inline, private] |
Definition at line 129 of file FileIndex.h.
References edm::Transient< T >::get(), and transients_.
Referenced by addEntry(), findEventEntryPosition(), findEventPosition(), findPosition(), sortBy_Run_Lumi_Event(), and sortBy_Run_Lumi_EventEntry().
{return transients_.get().sortState_;}
std::vector<Element> edm::FileIndex::entries_ [private] |
Definition at line 131 of file FileIndex.h.
Referenced by addEntry(), allEventsInEntryOrder(), begin(), containsEvent(), containsLumi(), containsRun(), empty(), end(), erase(), findEventEntryPosition(), findEventPosition(), findLumiOrRunPosition(), findLumiPosition(), findPosition(), findRunPosition(), size(), sortBy_Run_Lumi_Event(), and sortBy_Run_Lumi_EventEntry().
Transient<Transients> edm::FileIndex::transients_ [mutable, private] |
Definition at line 132 of file FileIndex.h.
Referenced by allInEntryOrder(), resultCached(), and sortState().