MySQL 9.0.0
Source Code Documentation
base_list Class Reference

#include <sql_list.h>

Inheritance diagram for base_list:
[legend]

Public Member Functions

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
 

Public Attributes

uint elements
 

Protected Member Functions

void after (void *info, list_node *node)
 
bool after (void *info, list_node *node, MEM_ROOT *mem_root)
 

Protected Attributes

list_nodefirst
 
list_node ** last
 

Friends

class base_list_iterator
 
class error_list
 
class error_list_iterator
 

Constructor & Destructor Documentation

◆ base_list() [1/3]

base_list::base_list ( )
inline

◆ base_list() [2/3]

base_list::base_list ( const base_list tmp)
inline

This is a shallow copy constructor that implicitly passes the ownership from the source list to the new instance.

The old instance is not updated, so both objects end up sharing the same nodes. If one of the instances then adds or removes a node, the other becomes out of sync ('last' pointer), while still operational. Some old code uses and relies on this behaviour. This logic is quite tricky: please do not use it in any new code.

◆ base_list() [3/3]

base_list::base_list ( const base_list rhs,
MEM_ROOT mem_root 
)

Construct a deep copy of the argument in memory root mem_root.

The elements themselves are copied by pointer.

Member Function Documentation

◆ after() [1/2]

void base_list::after ( void *  info,
list_node node 
)
inlineprotected

◆ after() [2/2]

bool base_list::after ( void *  info,
list_node node,
MEM_ROOT mem_root 
)
inlineprotected

◆ clear()

void base_list::clear ( )
inline

◆ concat()

void base_list::concat ( base_list list)
inline

◆ disjoin()

void base_list::disjoin ( base_list list)
inline

◆ first_node()

list_node * base_list::first_node ( )
inline

◆ head() [1/2]

void * base_list::head ( )
inline

◆ head() [2/2]

const void * base_list::head ( ) const
inline

◆ head_ref()

void ** base_list::head_ref ( )
inline

◆ is_empty()

bool base_list::is_empty ( void  ) const
inline

◆ last_node()

list_node * base_list::last_node ( )
inline

◆ last_ref()

list_node * base_list::last_ref ( )
inline

◆ operator=()

base_list & base_list::operator= ( const base_list tmp)
inline

◆ operator==()

bool base_list::operator== ( const base_list rhs) const
inline

◆ pop()

void * base_list::pop ( void  )
inline

◆ prepend()

void base_list::prepend ( base_list list)
inline

◆ push_back() [1/2]

bool base_list::push_back ( void *  info)
inline

◆ push_back() [2/2]

bool base_list::push_back ( void *  info,
MEM_ROOT mem_root 
)
inline

◆ push_front() [1/2]

bool base_list::push_front ( void *  info)
inline

◆ push_front() [2/2]

bool base_list::push_front ( void *  info,
MEM_ROOT mem_root 
)
inline

◆ remove()

void base_list::remove ( list_node **  prev)
inline

◆ size()

uint base_list::size ( ) const
inline

◆ swap()

void base_list::swap ( base_list rhs)
inline

Swap two lists.

Friends And Related Function Documentation

◆ base_list_iterator

friend class base_list_iterator
friend

◆ error_list

friend class error_list
friend

◆ error_list_iterator

friend class error_list_iterator
friend

Member Data Documentation

◆ elements

uint base_list::elements

◆ first

list_node* base_list::first
protected

◆ last

list_node ** base_list::last
protected

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