예제 #1
0
	void fetchPrev(SpanItr &s){
		if(s-- == spans.begin()) {
			uint64_t prvInterval=prevInterval(s->first, timeUnit);
			s=spans.insert(std::pair<int64_t,spanView*>(prvInterval, new spanView(this, prvInterval, s->first))).first;
		}
	};
예제 #2
0
	SpanItr fetchSpan(int64_t idx){
		SpanItr ret=spans.find(idx); 
		if(ret!=spans.end()) return ret;
		spans.insert(std::pair<int64_t,spanView*>(idx, new spanView(this, idx, nextInterval(idx,timeUnit)))).first;
	};
예제 #3
0
	void fetchNext(SpanItr &s){
		if(++s==spans.end()) {
			uint64_t nxtInterval=nextInterval(s->first, timeUnit);
			s=spans.insert(std::pair<int64_t,spanView*>(nxtInterval, new spanView(this, s->first,nxtInterval))).first;
		}
	};
예제 #4
0
	// The 'move' commands fetch spans as needed then set leftMostSpan and backLeft.
	void moveTo(uint64_t idx){
		SpanItr ret=spans.find(idx);
		if(ret!=spans.end()) leftMostSpan=ret;
		else leftMostSpan=spans.insert(std::pair<int64_t,spanView*>(idx, new spanView(this, idx, nextInterval(idx,timeUnit)))).first;
		backLeft=0;
	};