taco-db  0.1.0
Public Member Functions | List of all members
taco::ItemIterator Class Referenceabstract

A pure abstract iterator over items (i.e., plain byte arrays). More...

#include <extsort/ItemIterator.h>

Inheritance diagram for taco::ItemIterator:
taco::ExternalSort::OutputIterator

Public Member Functions

virtual ~ItemIterator ()
 Destructor. More...
 
virtual bool Next ()=0
 Subclass implementation should override the Next() function for moving to the next item . More...
 
virtual const char * GetCurrentItem (FieldOffset &p_reclen)=0
 Returns the current serialized item that a previous Next() call moved this iterator to. More...
 
virtual bool SupportsRewind () const =0
 Whether the subclass implementation supports rewinding. More...
 
virtual uint64_t SavePosition () const =0
 Saves the current posision if the subclass implementation supports rewinding. More...
 
virtual void Rewind (uint64_t pos)=0
 Rewinds the iterator back to a previously saved posision if the subclass implementation supports rewinding. More...
 
virtual void EndScan ()=0
 Ends the scan. More...
 

Detailed Description

A pure abstract iterator over items (i.e., plain byte arrays).

An implementation may optionally supports rewinding (e.g., the output iterator of ExtSort). One may check if the underlying support allows rewinding by calling the virtual function SupportsRewind().

The rewind interface uses a uint64_t position (rather than RecordId). See below for explanation.

Constructor & Destructor Documentation

◆ ~ItemIterator()

virtual taco::ItemIterator::~ItemIterator ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ EndScan()

virtual void taco::ItemIterator::EndScan ( )
pure virtual

Ends the scan.

Implemented in taco::ExternalSort::OutputIterator.

◆ GetCurrentItem()

virtual const char* taco::ItemIterator::GetCurrentItem ( FieldOffset p_reclen)
pure virtual

Returns the current serialized item that a previous Next() call moved this iterator to.

p_reclen is set to the length of the item upon return.

Implemented in taco::ExternalSort::OutputIterator.

◆ Next()

virtual bool taco::ItemIterator::Next ( )
pure virtual

Subclass implementation should override the Next() function for moving to the next item .

Upon a successful return, GetCurrentItem() should return a pointer to a byte array which contains the item (which may be a heap record, an index record or something else). The interpretation of the record is up to the caller.

Implemented in taco::ExternalSort::OutputIterator.

◆ Rewind()

virtual void taco::ItemIterator::Rewind ( uint64_t  pos)
pure virtual

Rewinds the iterator back to a previously saved posision if the subclass implementation supports rewinding.

The argument pos must be a value previously returned by a call to SavePosition() on this iterator, otherwise it is undefined.

It is undefined if called on a ItemIterator such that this->SupportsRewind() == false.

Implemented in taco::ExternalSort::OutputIterator.

◆ SavePosition()

virtual uint64_t taco::ItemIterator::SavePosition ( ) const
pure virtual

Saves the current posision if the subclass implementation supports rewinding.

The position is expressed as an opaque uint64_t rather than RecordId (which may fit into a uint64_t), so that the implementation can actually store other kinds of position pointer/index.

It is undefined if called on a ItemIterator such that this->SupportsRewind() == false.

Implemented in taco::ExternalSort::OutputIterator.

◆ SupportsRewind()

virtual bool taco::ItemIterator::SupportsRewind ( ) const
pure virtual

Whether the subclass implementation supports rewinding.

Implemented in taco::ExternalSort::OutputIterator.


The documentation for this class was generated from the following file: