MySQL 8.4.2
Source Code Documentation
|
The iterator class itself is private. More...
Public Member Functions | |
Query_term_iterator (Query_term *root) | |
Construct an iterator over the query term tree rooted in root, optionally skipping the leaves. More... | |
Query_term_iterator ()=default | |
Query_term_iterator & | operator++ () |
Query_term * | operator* () |
bool | operator== (const Query_term_iterator &other) const |
bool | operator!= (const Query_term_iterator &other) const |
Private Member Functions | |
void | dive_to_leftmost_leaf_of_child () |
Starting at m_current->m_children [m_child_index], dive down through any left-most (index == 0) further children till we find left-most leaf term (a Query_block ) under the child pointed to by m_child_index . More... | |
void | prepare_for_next_sibling () |
Find the index of the next sibling, if any, of m_current qua child of its parent, so we can visit it: assign it to m_child_idx . More... | |
Private Attributes | |
Query_term * | m_current {nullptr} |
Iterator state consists of the next two member variables. More... | |
uint | m_child_idx {0} |
Used to find next child node to dive into, see set_next_child_idx . More... | |
The iterator class itself is private.
Only used directly by begin and end
|
inlineexplicit |
Construct an iterator over the query term tree rooted in root, optionally skipping the leaves.
Skipping is useful for those cases where the leaves are visited separately[1] and we only want to visit the set operation nodes in the tree. [1] By walking the Query_expression::first_query_block and Query_block::next_query_block chain
root | the node to start iteration from |
|
default |
|
inlineprivate |
Starting at m_current->m_children
[m_child_index], dive down through any left-most (index == 0) further children till we find left-most leaf term (a Query_block
) under the child pointed to by m_child_index
.
After the dive, m_child_index
will be zero, and m_current
will be set to the leaf term.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
Find the index of the next sibling, if any, of m_current
qua child of its parent, so we can visit it: assign it to m_child_idx
.
Setting m_child_idx
to a value of Query_term::child_count
means we signal that we are done. Also, m_current
is set to its parent.
|
private |
Used to find next child node to dive into, see set_next_child_idx
.
|
private |
Iterator state consists of the next two member variables.