MySQL 9.1.0
Source Code Documentation
queues.h File Reference

Code for handling of priority queues. More...

#include <stddef.h>
#include <sys/types.h>
#include "my_inttypes.h"
#include "mysql/psi/psi_memory.h"

Go to the source code of this file.

Classes

struct  QUEUE
 

Macros

#define queue_top(queue)   ((queue)->root[1])
 
#define queue_element(queue, index)   ((queue)->root[index + 1])
 
#define queue_end(queue)   ((queue)->root[(queue)->elements])
 

Typedefs

typedef int(* queue_compare) (void *, uchar *, uchar *)
 

Functions

void _downheap (QUEUE *queue, uint idx)
 
void queue_fix (QUEUE *queue)
 
static void queue_replaced (QUEUE *queue)
 
static void queue_set_max_at_top (QUEUE *queue, int set_arg)
 
int init_queue (QUEUE *queue, PSI_memory_key psi_key, uint max_elements, uint offset_to_key, bool max_at_top, queue_compare compare, void *first_cmp_arg)
 
int reinit_queue (QUEUE *queue, PSI_memory_key psi_key, uint max_elements, uint offset_to_key, bool max_at_top, queue_compare compare, void *first_cmp_arg)
 
void delete_queue (QUEUE *queue)
 
void queue_insert (QUEUE *queue, uchar *element)
 
ucharqueue_remove (QUEUE *queue, uint idx)
 
static void queue_remove_all (QUEUE *queue)
 
static bool queue_is_full (QUEUE *queue)
 
static bool is_queue_inited (QUEUE *queue)
 

Detailed Description

Code for handling of priority queues.

Implementation of queues from "Algorithms in C" by Robert Sedgewick.

Macro Definition Documentation

◆ queue_element

#define queue_element (   queue,
  index 
)    ((queue)->root[index + 1])

◆ queue_end

#define queue_end (   queue)    ((queue)->root[(queue)->elements])

◆ queue_top

#define queue_top (   queue)    ((queue)->root[1])

Typedef Documentation

◆ queue_compare

typedef int(* queue_compare) (void *, uchar *, uchar *)

Function Documentation

◆ _downheap()

void _downheap ( QUEUE queue,
uint  idx 
)

◆ delete_queue()

void delete_queue ( QUEUE queue)

◆ init_queue()

int init_queue ( QUEUE queue,
PSI_memory_key  psi_key,
uint  max_elements,
uint  offset_to_key,
bool  max_at_top,
queue_compare  compare,
void *  first_cmp_arg 
)

◆ is_queue_inited()

static bool is_queue_inited ( QUEUE queue)
inlinestatic

◆ queue_fix()

void queue_fix ( QUEUE queue)

◆ queue_insert()

void queue_insert ( QUEUE queue,
uchar element 
)

◆ queue_is_full()

static bool queue_is_full ( QUEUE queue)
inlinestatic

◆ queue_remove()

uchar * queue_remove ( QUEUE queue,
uint  idx 
)

◆ queue_remove_all()

static void queue_remove_all ( QUEUE queue)
inlinestatic

◆ queue_replaced()

static void queue_replaced ( QUEUE queue)
inlinestatic

◆ queue_set_max_at_top()

static void queue_set_max_at_top ( QUEUE queue,
int  set_arg 
)
inlinestatic

◆ reinit_queue()

int reinit_queue ( QUEUE queue,
PSI_memory_key  psi_key,
uint  max_elements,
uint  offset_to_key,
bool  max_at_top,
queue_compare  compare,
void *  first_cmp_arg 
)