#include "SlotIndexer.h"
-
+#include "Slot.h"
+#include "Error.h"
+#include "SlotBuffer.h"
/**
* Slot indexer allows slots in both the slot buffer and the new
* server response to looked up in a consistent fashion.
* @version 1.0
*/
-SlotIndexer::SlotIndexer(Array<Slot*> * _updates, SlotBuffer * _buffer) :
- buffer(_buffer),
+SlotIndexer::SlotIndexer(Array<Slot *> *_updates, SlotBuffer *_buffer) :
updates(_updates),
+ buffer(_buffer),
firstslotseqnum(updates->get(0)->getSequenceNumber()) {
}
-Slot * SlotIndexer::getSlot(int64_t seqnum) {
+Slot *SlotIndexer::getSlot(int64_t seqnum) {
if (seqnum >= firstslotseqnum) {
int32_t offset = (int32_t) (seqnum - firstslotseqnum);
if (offset >= updates->length())