MySQL 8.0.40
Source Code Documentation
List< T > Class Template Reference

#include <sql_list.h>

Inheritance diagram for List< T >:
[legend]

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)
 
Listoperator= (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_listoperator= (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_nodelast_node ()
 
list_nodefirst_node ()
 
void * head ()
 
const void * head () const
 
void ** head_ref ()
 
bool is_empty () const
 
list_nodelast_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_nodefirst
 
list_node ** last
 

Member Typedef Documentation

◆ const_iterator

template<class T >
using List< T >::const_iterator = List_STL_Iterator<const T>

◆ iterator

template<class T >
using List< T >::iterator = List_STL_Iterator<T>

Constructor & Destructor Documentation

◆ List() [1/3]

template<class T >
List< T >::List ( )
inline

◆ List() [2/3]

template<class T >
List< T >::List ( const List< T > &  tmp)
inline

◆ List() [3/3]

template<class T >
List< T >::List ( const List< T > &  tmp,
MEM_ROOT mem_root 
)
inline

Member Function Documentation

◆ begin() [1/2]

template<class T >
iterator List< T >::begin ( void  )
inline

◆ begin() [2/2]

template<class T >
const_iterator List< T >::begin ( void  ) const
inline

◆ cbegin()

template<class T >
const_iterator List< T >::cbegin ( ) const
inline

◆ cend()

template<class T >
const_iterator List< T >::cend ( ) const
inline

◆ concat()

template<class T >
void List< T >::concat ( List< T > *  list)
inline

◆ delete_elements()

template<class T >
void List< T >::delete_elements ( void  )
inline

◆ destroy_elements()

template<class T >
void List< T >::destroy_elements ( void  )
inline

◆ disjoin()

template<class T >
void List< T >::disjoin ( List< T > *  list)
inline

◆ end() [1/2]

template<class T >
iterator List< T >::end ( void  )
inline

◆ end() [2/2]

template<class T >
const_iterator List< T >::end ( void  ) const
inline

◆ head() [1/2]

template<class T >
T * List< T >::head ( )
inline

◆ head() [2/2]

template<class T >
const T * List< T >::head ( ) const
inline

◆ head_ref()

template<class T >
T ** List< T >::head_ref ( )
inline

◆ operator=()

template<class T >
List & List< T >::operator= ( const List< T > &  tmp)
inline

◆ operator[]()

template<class T >
T * List< T >::operator[] ( uint  index) const
inline

◆ pop()

template<class T >
T * List< T >::pop ( void  )
inline

◆ prepend()

template<class T >
void List< T >::prepend ( List< T > *  list)
inline

◆ push_back() [1/2]

template<class T >
bool List< T >::push_back ( T *  a)
inline

◆ push_back() [2/2]

template<class T >
bool List< T >::push_back ( T *  a,
MEM_ROOT mem_root 
)
inline

◆ push_front() [1/2]

template<class T >
bool List< T >::push_front ( T *  a)
inline

◆ push_front() [2/2]

template<class T >
bool List< T >::push_front ( T *  a,
MEM_ROOT mem_root 
)
inline

◆ replace()

template<class T >
void List< T >::replace ( uint  index,
T *  new_value 
)
inline

◆ sort()

template<class T >
template<typename Node_cmp_func >
void List< T >::sort ( Node_cmp_func  cmp)
inline

Sort the list.

Parameters
cmpnode 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.

◆ swap_elts()

template<class T >
bool List< T >::swap_elts ( uint  index1,
uint  index2 
)
inline

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