MySQL  8.0.21
Source Code Documentation
fut0lst.h File Reference

File-based list utilities. More...

#include "univ.i"
#include "fil0fil.h"
#include "mtr0mtr.h"
#include "fut0lst.ic"

Go to the source code of this file.

Classes

struct  flst_bnode_t
 In-memory representation of flst_base_node_t. More...
 

Typedefs

typedef byte flst_base_node_t
 
typedef byte flst_node_t
 

Functions

UNIV_INLINE void flst_init (flst_base_node_t *base, mtr_t *mtr)
 Initializes a list base node. More...
 
void flst_add_last (flst_base_node_t *base, flst_node_t *node, mtr_t *mtr)
 Adds a node as the last node in a list. More...
 
void flst_add_first (flst_base_node_t *base, flst_node_t *node, mtr_t *mtr)
 Adds a node as the first node in a list. More...
 
void flst_remove (flst_base_node_t *base, flst_node_t *node2, mtr_t *mtr)
 Removes a node. More...
 
UNIV_INLINE ulint flst_get_len (const flst_base_node_t *base)
 Get the length of a list. More...
 
UNIV_INLINE fil_addr_t flst_get_first (const flst_base_node_t *base, mtr_t *mtr)
 Gets list first node address. More...
 
UNIV_INLINE fil_addr_t flst_get_last (const flst_base_node_t *base, mtr_t *mtr)
 Gets list last node address. More...
 
UNIV_INLINE fil_addr_t flst_get_next_addr (const flst_node_t *node, mtr_t *mtr)
 Gets list next node address. More...
 
UNIV_INLINE fil_addr_t flst_get_prev_addr (const flst_node_t *node, mtr_t *mtr)
 Gets list prev node address. More...
 
UNIV_INLINE void flst_write_addr (fil_faddr_t *faddr, fil_addr_t addr, mtr_t *mtr)
 Writes a file address. More...
 
UNIV_INLINE fil_addr_t flst_read_addr (const fil_faddr_t *faddr, mtr_t *mtr)
 Reads a file address. More...
 
ibool flst_validate (const flst_base_node_t *base, mtr_t *mtr1)
 Validates a file-based list. More...
 
void flst_insert_after (flst_base_node_t *base, flst_node_t *node1, flst_node_t *node2, mtr_t *mtr)
 Inserts a node after another in a list. More...
 
void flst_insert_before (flst_base_node_t *base, flst_node_t *node2, flst_node_t *node3, mtr_t *mtr)
 Inserts a node before another in a list. More...
 
std::ostream & operator<< (std::ostream &out, const flst_bnode_t &obj)
 

Variables

constexpr ulint FLST_BASE_NODE_SIZE = 4 + 2 * FIL_ADDR_SIZE
 
constexpr ulint FLST_NODE_SIZE = 2 * FIL_ADDR_SIZE
 

Detailed Description

File-based list utilities.

Created 11/28/1995 Heikki Tuuri

Typedef Documentation

◆ flst_base_node_t

◆ flst_node_t

typedef byte flst_node_t

Function Documentation

◆ flst_add_first()

void flst_add_first ( flst_base_node_t base,
flst_node_t node,
mtr_t mtr 
)

Adds a node as the first node in a list.

in: mini-transaction handle

Parameters
basein: pointer to base node of list
nodein: node to add
mtrin: mini-transaction handle

◆ flst_add_last()

void flst_add_last ( flst_base_node_t base,
flst_node_t node,
mtr_t mtr 
)

Adds a node as the last node in a list.

in: mini-transaction handle

Parameters
basein: pointer to base node of list
nodein: node to add
mtrin: mini-transaction handle

◆ flst_get_first()

UNIV_INLINE fil_addr_t flst_get_first ( const flst_base_node_t base,
mtr_t mtr 
)

Gets list first node address.

Parameters
[in]basepointer to base node
[in]mtrmini-transaction handle
Returns
file address

◆ flst_get_last()

UNIV_INLINE fil_addr_t flst_get_last ( const flst_base_node_t base,
mtr_t mtr 
)

Gets list last node address.

Parameters
[in]basepointer to base node
[in]mtrmini-transaction handle
Returns
file address

◆ flst_get_len()

UNIV_INLINE ulint flst_get_len ( const flst_base_node_t base)

Get the length of a list.

Parameters
[in]basebase node
Returns
length

◆ flst_get_next_addr()

UNIV_INLINE fil_addr_t flst_get_next_addr ( const flst_node_t node,
mtr_t mtr 
)

Gets list next node address.

Parameters
[in]nodepointer to node
[in]mtrmini-transaction handle
Returns
file address

◆ flst_get_prev_addr()

UNIV_INLINE fil_addr_t flst_get_prev_addr ( const flst_node_t node,
mtr_t mtr 
)

Gets list prev node address.

Parameters
[in]nodepointer to node
[in]mtrmini-transaction handle
Returns
file address

◆ flst_init()

UNIV_INLINE void flst_init ( flst_base_node_t base,
mtr_t mtr 
)

Initializes a list base node.

Parameters
[in]basepointer to base node
[in]mtrmini-transaction handle

◆ flst_insert_after()

void flst_insert_after ( flst_base_node_t base,
flst_node_t node1,
flst_node_t node2,
mtr_t mtr 
)

Inserts a node after another in a list.

Parameters
[in]basepointer to base node of list
[in]node1node to insert after
[in]node2node to add
[in]mtrmini-transaction handle.

in: mini-transaction handle

Parameters
basein: pointer to base node of list
node1in: node to insert after
node2in: node to add
mtrin: mini-transaction handle

◆ flst_insert_before()

void flst_insert_before ( flst_base_node_t base,
flst_node_t node2,
flst_node_t node3,
mtr_t mtr 
)

Inserts a node before another in a list.

Parameters
[in]basepointer to base node of list
[in]node2node to insert
[in]node3node to insert before
[in]mtrmini-transaction handle.

in: mini-transaction handle

Parameters
basein: pointer to base node of list
node2in: node to insert
node3in: node to insert before
mtrin: mini-transaction handle

◆ flst_read_addr()

UNIV_INLINE fil_addr_t flst_read_addr ( const fil_faddr_t faddr,
mtr_t mtr 
)

Reads a file address.

Parameters
[in]faddrpointer to file faddress
[in]mtrmini-transaction handle
Returns
file address

◆ flst_remove()

void flst_remove ( flst_base_node_t base,
flst_node_t node2,
mtr_t mtr 
)

Removes a node.

in: mini-transaction handle

Parameters
basein: pointer to base node of list
node2in: node to remove
mtrin: mini-transaction handle

◆ flst_validate()

ibool flst_validate ( const flst_base_node_t base,
mtr_t mtr1 
)

Validates a file-based list.

Returns
true if ok in: mtr
true if ok
Parameters
basein: pointer to base node of list
mtr1in: mtr

◆ flst_write_addr()

UNIV_INLINE void flst_write_addr ( fil_faddr_t faddr,
fil_addr_t  addr,
mtr_t mtr 
)

Writes a file address.

Parameters
[in]faddrpointer to file faddress
[in]addrfile address
[in]mtrmini-transaction handle

◆ operator<<()

std::ostream& operator<< ( std::ostream &  out,
const flst_bnode_t obj 
)
inline

Variable Documentation

◆ FLST_BASE_NODE_SIZE

constexpr ulint FLST_BASE_NODE_SIZE = 4 + 2 * FIL_ADDR_SIZE

◆ FLST_NODE_SIZE

constexpr ulint FLST_NODE_SIZE = 2 * FIL_ADDR_SIZE