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
A pure abstract iterator over items (i.e., plain byte arrays).
Definition: ItemIterator.h:18
virtual void EndScan()=0
Ends the scan.
virtual bool Next()=0
Subclass implementation should override the Next() function for moving to the next item .
virtual bool SupportsRewind() const =0
Whether the subclass implementation supports rewinding.
virtual uint64_t SavePosition() const =0
Saves the current posision if the subclass implementation supports rewinding.
virtual void Rewind(uint64_t pos)=0
Rewinds the iterator back to a previously saved posision if the subclass implementation supports rewi...
virtual const char * GetCurrentItem(FieldOffset &p_reclen)=0
Returns the current serialized item that a previous Next() call moved this iterator to.
virtual ~ItemIterator()
Destructor.
Definition: ItemIterator.h:23
Definition: datum.h:28
int16_t FieldOffset
Definition: tdb_base.h:211