#include <BoundsTracker.h>
Public Member Functions | |
| BoundsTracker (const FileGap::BoundList &lst) | |
| int | InFile (const VldTimeStamp &vts) |
| int | GetIndex () const |
| Return the index of the current iterator. | |
| VldTimeStamp | GetItrFirst () |
| VldTimeStamp | GetItrSecond () |
Private Attributes | |
| FileGap::BoundList | fList |
| FileGap::BoundList::iterator | fItr |
| int | fIndex |
Created on: Mon Oct 10 14:11:15 2005
Definition at line 32 of file BoundsTracker.h.
|
|
Definition at line 8 of file BoundsTracker.cxx. References done(), fItr, and fList. 00009 : fIndex(0) 00010 { 00011 cerr << "BoundList is " << lst.size() << " elements\n"; 00012 00013 FileGap::BoundList::const_iterator it, done = lst.end(); 00014 for (it=lst.begin(); it != done; ++it) { 00015 VldTimeStamp a = it->first; 00016 VldTimeStamp b = it->second; 00017 00018 fList.push_back(pair<VldTimeStamp,VldTimeStamp>(a,b)); 00019 } 00020 fItr = fList.begin(); 00021 }
|
|
|
Return the index of the current iterator.
Definition at line 54 of file BoundsTracker.cxx. Referenced by StndBmsSpin::Scan(). 00055 {
00056 return fIndex;
00057 }
|
|
|
Definition at line 58 of file BoundsTracker.cxx. References fItr. 00059 {
00060 return fItr->first;
00061 }
|
|
|
Definition at line 62 of file BoundsTracker.cxx. References fItr. 00063 {
00064 return fItr->second;
00065 }
|
|
|
Check if vts is inside a file. May reset current file count Return 0 if in file indicated by GetIndex() Return -1 if just before this file Return +1 if just after this file Return -2 if just before first file Return +2 if just after last file Definition at line 22 of file BoundsTracker.cxx. Referenced by StndBmsSpin::Scan(). 00023 {
00024 //cerr << "infile\n";
00025 size_t siz = fList.size();
00026 if (! siz) return -3;
00027 //cerr << "InFile("<< vts<<"), list size="<<siz<<"\n";
00028
00029 if (fItr->first <= vts && vts <= fItr->second) return 0;
00030
00031 if (vts < fItr->first) {
00032 if (fItr == fList.begin()) return -2;
00033 FileGap::BoundList::iterator prev = fItr;
00034 --prev;
00035 if (vts > prev->second) return -1;
00036 fItr = prev;
00037 --fIndex;
00038 return this->InFile(vts);
00039 }
00040
00041 if (vts > fItr->second) {
00042 FileGap::BoundList::iterator next = fItr;
00043 ++next;
00044 if (next == fList.end()) return +2;
00045 if (vts < next->first) return +1;
00046 fItr = next;
00047 ++fIndex;
00048 return this->InFile(vts);
00049 }
00050
00051 return 0; // never reach this
00052 }
|
|
|
Definition at line 35 of file BoundsTracker.h. |
|
|
Definition at line 34 of file BoundsTracker.h. Referenced by BoundsTracker(), GetItrFirst(), GetItrSecond(), and InFile(). |
|
|
Definition at line 33 of file BoundsTracker.h. Referenced by BoundsTracker(), and InFile(). |
1.3.9.1