MySQL 9.0.0
Source Code Documentation
temptable::Cursor Class Reference

A cursor for iterating over an Index. More...

#include <cursor.h>

Public Member Functions

 Cursor ()
 Constructor. More...
 
 Cursor (const Hash_duplicates_container::const_iterator &iterator)
 Constructor from Hash_duplicates iterator. More...
 
 Cursor (const Tree_container::const_iterator &iterator)
 Constructor from Tree iterator. More...
 
 Cursor (const Cursor &)=default
 
 Cursor (Cursor &&) noexcept=default
 
bool is_positioned () const
 Check if the cursor is positioned. More...
 
void unposition ()
 Unposition the cursor. More...
 
const Indexed_cellsindexed_cells () const
 Get the indexed cells of the current cursor position. More...
 
Storage::Elementrow () const
 Get a pointer to the row of the current cursor position. More...
 
void export_row_to_mysql (const Columns &columns, unsigned char *mysql_row, size_t mysql_row_length) const
 Export the row that is pointed to by this cursor in mysql write_row() format. More...
 
const Hash_duplicates_container::const_iterator & hash_iterator () const
 Get the underlying hash iterator. More...
 
const Tree_container::const_iterator & tree_iterator () const
 Get the underlying tree iterator. More...
 
Cursoroperator= (const Cursor &rhs)
 Copy-assign from another cursor. More...
 
Cursoroperator++ ()
 Advance the cursor forward. More...
 
Cursoroperator-- ()
 Recede the cursor backwards. More...
 
bool operator== (const Cursor &other) const
 Check if equal to another cursor. More...
 
bool operator!= (const Cursor &other) const
 Check if not equal to another cursor. More...
 

Private Types

enum class  Type : uint8_t { HASH , TREE }
 Type of the index the cursor iterates over. More...
 

Private Attributes

Type m_type
 Type of the index the cursor iterates over. More...
 
bool m_is_positioned
 Indicate whether the cursor is positioned. More...
 
Hash_duplicates_container::const_iterator m_hash_iterator
 Iterator that is used if m_type == Type::HASH. More...
 
Tree_container::const_iterator m_tree_iterator
 Iterator that is used if m_type == Type::TREE. More...
 

Detailed Description

A cursor for iterating over an Index.

Member Enumeration Documentation

◆ Type

enum class temptable::Cursor::Type : uint8_t
strongprivate

Type of the index the cursor iterates over.

Enumerator
HASH 

Hash index.

TREE 

Tree index.

Constructor & Destructor Documentation

◆ Cursor() [1/5]

temptable::Cursor::Cursor ( )
inline

Constructor.

◆ Cursor() [2/5]

temptable::Cursor::Cursor ( const Hash_duplicates_container::const_iterator &  iterator)
inlineexplicit

Constructor from Hash_duplicates iterator.

Parameters
[in]iteratorIterator for cursor initial position.

◆ Cursor() [3/5]

temptable::Cursor::Cursor ( const Tree_container::const_iterator &  iterator)
inlineexplicit

Constructor from Tree iterator.

Parameters
[in]iteratorIterator for cursor initial position.

◆ Cursor() [4/5]

temptable::Cursor::Cursor ( const Cursor )
default

◆ Cursor() [5/5]

temptable::Cursor::Cursor ( Cursor &&  )
defaultnoexcept

Member Function Documentation

◆ export_row_to_mysql()

void temptable::Cursor::export_row_to_mysql ( const Columns columns,
unsigned char *  mysql_row,
size_t  mysql_row_length 
) const
inline

Export the row that is pointed to by this cursor in mysql write_row() format.

Parameters
[in]columnsMetadata for the columns that constitute the row.
[out]mysql_rowDestination buffer to write the row to.
[in]mysql_row_lengthPresumed length of the mysql row in bytes.

◆ hash_iterator()

const Hash_duplicates_container::const_iterator & temptable::Cursor::hash_iterator ( ) const
inline

Get the underlying hash iterator.

The cursor must be on a hash index.

Returns
iterator

◆ indexed_cells()

const Indexed_cells & temptable::Cursor::indexed_cells ( ) const
inline

Get the indexed cells of the current cursor position.

Returns
indexed cells

◆ is_positioned()

bool temptable::Cursor::is_positioned ( ) const
inline

Check if the cursor is positioned.

Returns
true if positioned

◆ operator!=()

bool temptable::Cursor::operator!= ( const Cursor other) const
inline

Check if not equal to another cursor.

Returns
true if not equal
Parameters
[in]otherCursor to compare with.

◆ operator++()

Cursor & temptable::Cursor::operator++ ( )
inline

Advance the cursor forward.

Returns
*this

◆ operator--()

Cursor & temptable::Cursor::operator-- ( )
inline

Recede the cursor backwards.

Returns
*this

◆ operator=()

Cursor & temptable::Cursor::operator= ( const Cursor rhs)
inline

Copy-assign from another cursor.

Returns
*this
Parameters
[in]rhsSource cursor to assign from.

◆ operator==()

bool temptable::Cursor::operator== ( const Cursor other) const
inline

Check if equal to another cursor.

Returns
true if equal
Parameters
[in]otherCursor to compare with.

◆ row()

Storage::Element * temptable::Cursor::row ( ) const
inline

Get a pointer to the row of the current cursor position.

Returns
a pointer to a row

◆ tree_iterator()

const Tree_container::const_iterator & temptable::Cursor::tree_iterator ( ) const
inline

Get the underlying tree iterator.

The cursor must be on a tree index.

Returns
iterator

◆ unposition()

void temptable::Cursor::unposition ( )
inline

Unposition the cursor.

Member Data Documentation

◆ m_hash_iterator

Hash_duplicates_container::const_iterator temptable::Cursor::m_hash_iterator
private

Iterator that is used if m_type == Type::HASH.

◆ m_is_positioned

bool temptable::Cursor::m_is_positioned
private

Indicate whether the cursor is positioned.

◆ m_tree_iterator

Tree_container::const_iterator temptable::Cursor::m_tree_iterator
private

Iterator that is used if m_type == Type::TREE.

◆ m_type

Type temptable::Cursor::m_type
private

Type of the index the cursor iterates over.


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