const Key &PredictiveCursor::next() {
  if (cur_ == end_) {
    return Key::invalid_key();
  }

  if ((flags_ & ASCENDING_CURSOR) == ASCENDING_CURSOR) {
    return ascending_next();
  } else {
    return descending_next();
  }
}
Exemple #2
0
bool PredictiveCursor::next(Key *key) {
  if (cur_ == end_) {
    return false;
  }

  if ((flags_ & ASCENDING_CURSOR) == ASCENDING_CURSOR) {
    return ascending_next(key);
  } else {
    return descending_next(key);
  }
}
Exemple #3
0
const Key &KeyCursor::next() {
  if (finished_ || (count_ >= max_count_)) {
    return Key::invalid_key();
  }

  if ((flags_ & ASCENDING_CURSOR) == ASCENDING_CURSOR) {
    return ascending_next();
  } else {
    return descending_next();
  }
}