taco-db  0.1.0
ItemIterator.h
Go to the documentation of this file.
1 #ifndef EXTSORT_ITEMITERATOR_H
2 #define EXTSORT_ITEMITERATOR_H
3 
4 #include "tdb.h"
5 
6 namespace taco {
7 
18 class ItemIterator {
19 public:
23  virtual ~ItemIterator() {}
24 
33  virtual bool Next() = 0;
34 
40  virtual const char* GetCurrentItem(FieldOffset& p_reclen) = 0;
41 
45  virtual bool SupportsRewind() const = 0;
46 
56  virtual uint64_t SavePosition() const = 0;
57 
67  virtual void Rewind(uint64_t pos) = 0;
68 
72  virtual void EndScan() = 0;
73 };
74 
75 } // namespace taco
76 
77 #endif // EXTSORT_ITEMITERATOR_H
taco::ItemIterator::EndScan
virtual void EndScan()=0
Ends the scan.
taco::FieldOffset
int16_t FieldOffset
Definition: tdb_base.h:212
taco::ItemIterator::Next
virtual bool Next()=0
Subclass implementation should override the Next() function for moving to the next item .
taco::ItemIterator::Rewind
virtual void Rewind(uint64_t pos)=0
Rewinds the iterator back to a previously saved posision if the subclass implementation supports rewi...
taco::ItemIterator::SupportsRewind
virtual bool SupportsRewind() const =0
Whether the subclass implementation supports rewinding.
taco
Definition: datum.h:28
tdb.h
taco::ItemIterator::GetCurrentItem
virtual const char * GetCurrentItem(FieldOffset &p_reclen)=0
Returns the current serialized item that a previous Next() call moved this iterator to.
taco::ItemIterator
A pure abstract iterator over items (i.e., plain byte arrays).
Definition: ItemIterator.h:18
taco::ItemIterator::SavePosition
virtual uint64_t SavePosition() const =0
Saves the current posision if the subclass implementation supports rewinding.
taco::ItemIterator::~ItemIterator
virtual ~ItemIterator()
Destructor.
Definition: ItemIterator.h:23