コード例 #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;
	};