Tkrzw
Public Member Functions | Friends | List of all members
tkrzw::PolyIndex::Iterator Class Reference

Iterator for each record. More...

#include <tkrzw_index.h>

Public Member Functions

 ~Iterator ()
 Destructor. More...
 
 Iterator (const Iterator &rhs)=delete
 Copy and assignment are disabled. More...
 
Iteratoroperator= (const Iterator &rhs)=delete
 
void First ()
 Initializes the iterator to indicate the first record. More...
 
void Last ()
 Initializes the iterator to indicate the last record. More...
 
void Jump (std::string_view key, std::string_view value="")
 Initializes the iterator to indicate a specific range. More...
 
void Next ()
 Moves the iterator to the next record. More...
 
void Previous ()
 Moves the iterator to the previous record. More...
 
bool Get (std::string *key=nullptr, std::string *value=nullptr)
 Gets the key and the value of the current record of the iterator. More...
 

Friends

class PolyIndex
 

Detailed Description

Iterator for each record.

Constructor & Destructor Documentation

◆ ~Iterator()

tkrzw::PolyIndex::Iterator::~Iterator ( )

Destructor.

◆ Iterator()

tkrzw::PolyIndex::Iterator::Iterator ( const Iterator rhs)
explicitdelete

Copy and assignment are disabled.

Member Function Documentation

◆ First()

void tkrzw::PolyIndex::Iterator::First ( )

Initializes the iterator to indicate the first record.

◆ Last()

void tkrzw::PolyIndex::Iterator::Last ( )

Initializes the iterator to indicate the last record.

◆ Jump()

void tkrzw::PolyIndex::Iterator::Jump ( std::string_view  key,
std::string_view  value = "" 
)

Initializes the iterator to indicate a specific range.

Parameters
keyThe key of the lower bound.
valueThe value of the lower bound.

◆ Next()

void tkrzw::PolyIndex::Iterator::Next ( )

Moves the iterator to the next record.

◆ Previous()

void tkrzw::PolyIndex::Iterator::Previous ( )

Moves the iterator to the previous record.

◆ Get()

bool tkrzw::PolyIndex::Iterator::Get ( std::string *  key = nullptr,
std::string *  value = nullptr 
)

Gets the key and the value of the current record of the iterator.

Parameters
keyThe pointer to a string object to contain the record key. If it is nullptr, the key data is ignored.
valueThe pointer to a string object to contain the record value. If it is nullptr, the value data is ignored.
Returns
True on success or false on failure. If theres no record to fetch, false is returned.