drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
ut0vec.h File Reference
#include "univ.i"
#include "mem0mem.h"
Include dependency graph for ut0vec.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ib_vector_struct

Typedefs

typedef struct ib_vector_struct ib_vector_t

Functions

UNIV_INTERN ib_vector_t * ib_vector_create (mem_heap_t *heap, ulint size)
UNIV_INTERN void ib_vector_push (ib_vector_t *vec, void *elem)
UNIV_INLINE ulint ib_vector_size (const ib_vector_t *vec)
UNIV_INLINE ibool ib_vector_is_empty (const ib_vector_t *vec)
UNIV_INLINE void * ib_vector_get (ib_vector_t *vec, ulint n)
UNIV_INLINE void * ib_vector_get_last (ib_vector_t *vec)
UNIV_INLINE void ib_vector_set (ib_vector_t *vec, ulint n, void *elem)
UNIV_INLINE void * ib_vector_pop (ib_vector_t *vec)
UNIV_INLINE void ib_vector_free (ib_vector_t *vec)

Detailed Description

A vector of pointers to data items

Created 4/6/2006 Osku Salerma

Definition in file ut0vec.h.

Macro Definition Documentation

◆ IB_VECTOR_H

#define IB_VECTOR_H

Definition at line 28 of file ut0vec.h.

Typedef Documentation

◆ ib_vector_t

typedef struct ib_vector_struct ib_vector_t

An automatically resizing vector data type.

Definition at line 34 of file ut0vec.h.

Function Documentation

◆ ib_vector_create()

UNIV_INTERN ib_vector_t * ib_vector_create ( mem_heap_t * heap,
ulint size )

Create a new vector with the given initial size.

Returns
vector in: initial size

Create a new vector with the given initial size.

Returns
vector
Parameters
heapin: heap
sizein: initial size

Definition at line 37 of file ut0vec.cc.

◆ ib_vector_free()

UNIV_INLINE void ib_vector_free ( ib_vector_t * vec)

Free the underlying heap of the vector. Note that vec is invalid after this call. in,own: vector

◆ ib_vector_get()

UNIV_INLINE void * ib_vector_get ( ib_vector_t * vec,
ulint n )

Get the n'th element.

Returns
n'th element in: element index to get
Parameters
vecin: vector

◆ ib_vector_get_last()

UNIV_INLINE void * ib_vector_get_last ( ib_vector_t * vec)

Get last element. The vector must not be empty.

Returns
last element in: vector

◆ ib_vector_is_empty()

UNIV_INLINE ibool ib_vector_is_empty ( const ib_vector_t * vec)

Test whether a vector is empty or not.

Returns
TRUE if empty in: vector

◆ ib_vector_pop()

UNIV_INLINE void * ib_vector_pop ( ib_vector_t * vec)

Remove the last element from the vector. in: vector

◆ ib_vector_push()

UNIV_INTERN void ib_vector_push ( ib_vector_t * vec,
void * elem )

Push a new element to the vector, increasing its size if necessary. in: data element

Push a new element to the vector, increasing its size if necessary.

Parameters
vecin: vector
elemin: data element

Definition at line 58 of file ut0vec.cc.

◆ ib_vector_set()

UNIV_INLINE void ib_vector_set ( ib_vector_t * vec,
ulint n,
void * elem )

Set the n'th element. in: data element

Parameters
vecin/out: vector
nin: element index to set

◆ ib_vector_size()

UNIV_INLINE ulint ib_vector_size ( const ib_vector_t * vec)

Get the number of elements in the vector.

Returns
number of elements in vector in: vector