![]() |
MySQL 9.5.0
Source Code Documentation
|
#include <sql_list.h>
Public Types | |
| using | iterator = List_STL_Iterator< T > |
| using | const_iterator = List_STL_Iterator< const T > |
Public Member Functions | |
| List () | |
| List (const List< T > &tmp) | |
| List & | operator= (const List &tmp) |
| List (const List< T > &tmp, MEM_ROOT *mem_root) | |
| bool | push_back (T *a) |
| bool | push_back (T *a, MEM_ROOT *mem_root) |
| bool | push_front (T *a) |
| bool | push_front (T *a, MEM_ROOT *mem_root) |
| T * | head () |
| const T * | head () const |
| T ** | head_ref () |
| T * | pop () |
| void | concat (List< T > *list) |
| void | disjoin (List< T > *list) |
| void | prepend (List< T > *list) |
| void | delete_elements (void) |
| void | destroy_elements (void) |
| T * | operator[] (uint index) const |
| void | replace (uint index, T *new_value) |
| bool | swap_elts (uint index1, uint index2) |
| template<typename Node_cmp_func > | |
| void | sort (Node_cmp_func cmp) |
| Sort the list. More... | |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
Public Member Functions inherited from base_list | |
| bool | operator== (const base_list &rhs) const |
| void | clear () |
| base_list () | |
| base_list (const base_list &tmp) | |
| This is a shallow copy constructor that implicitly passes the ownership from the source list to the new instance. More... | |
| base_list & | operator= (const base_list &tmp) |
| base_list (const base_list &rhs, MEM_ROOT *mem_root) | |
| Construct a deep copy of the argument in memory root mem_root. More... | |
| bool | push_back (void *info) |
| bool | push_back (void *info, MEM_ROOT *mem_root) |
| bool | push_front (void *info) |
| bool | push_front (void *info, MEM_ROOT *mem_root) |
| void | remove (list_node **prev) |
| void | concat (base_list *list) |
| void * | pop (void) |
| void | disjoin (base_list *list) |
| void | prepend (base_list *list) |
| void | swap (base_list &rhs) |
| Swap two lists. More... | |
| list_node * | last_node () |
| list_node * | first_node () |
| void * | head () |
| const void * | head () const |
| void ** | head_ref () |
| bool | is_empty () const |
| list_node * | last_ref () |
| uint | size () const |
Additional Inherited Members | |
Public Attributes inherited from base_list | |
| uint | elements |
Protected Member Functions inherited from base_list | |
| void | after (void *info, list_node *node) |
| bool | after (void *info, list_node *node, MEM_ROOT *mem_root) |
Protected Attributes inherited from base_list | |
| list_node * | first |
| list_node ** | last |
| using List< T >::const_iterator = List_STL_Iterator<const T> |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Sort the list.
| cmp | node comparison function |
The function sorts list nodes by an exchange sort algorithm. The order of list nodes isn't changed, values of info fields are swapped instead. Due to this, list iterators that are initialized before sort could be safely used after sort, i.e they wouldn't cause a crash. As this isn't an effective algorithm the list to be sorted is supposed to be short.