Ejemplo n.º 1
0
	bool increment(llong* id, valvec<byte>* key) override {
		auto owner = static_cast<const MockReadonlyIndex*>(m_index.get());
		assert(nullptr != id);
		if (terark_likely(m_pos > 0)) {
			owner->getIndexKey(id, key, --m_pos);
			return true;
		}
		return false;
	}
Ejemplo n.º 2
0
	int seekLowerBound(fstring key, llong* id, valvec<byte>* retKey) override {
		auto owner = static_cast<const MockReadonlyIndex*>(m_index.get());
		int ret = owner->forwardLowerBound(key, &m_pos);
		if (ret >= 0) {
			assert(m_pos < owner->m_ids.size());
			owner->getIndexKey(id, retKey, m_pos);
			m_pos++;
		}
		return ret;
	}
Ejemplo n.º 3
0
	void reset() {
		auto owner = static_cast<const MockReadonlyIndex*>(m_index.get());
		m_pos = owner->m_ids.size();
	}