Drizzled Public API Documentation

ut0vec.h File Reference

#include "univ.i"
#include "mem0mem.h"
#include "ut0vec.ic"

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_tib_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_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.


Typedef Documentation

typedef struct ib_vector_struct ib_vector_t

An automatically resizing vector data type.

Definition at line 34 of file ut0vec.h.


Function Documentation

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.

References ib_vector_struct::data, ib_vector_struct::heap, ib_vector_create(), mem_heap_alloc(), ib_vector_struct::total, ib_vector_struct::used, and ut_a.

Referenced by ib_vector_create(), pars_info_add_function(), pars_info_add_id(), pars_info_add_literal(), and trx_create().

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

Referenced by trx_free().

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

Referenced by pars_info_get_bound_id(), pars_info_get_bound_lit(), and pars_info_get_user_func().

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

Referenced by lock_release_autoinc_locks(), lock_trx_holds_autoinc_locks(), and trx_free().

UNIV_INLINE void* ib_vector_pop ( ib_vector_t vec)

Remove the last element from the vector. in: vector

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.

References ib_vector_struct::data, ib_vector_struct::heap, ib_vector_push(), mem_heap_alloc(), ib_vector_struct::total, and ib_vector_struct::used.

Referenced by ib_vector_push(), pars_info_add_function(), pars_info_add_id(), and pars_info_add_literal().

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

Referenced by lock_release_off_kernel(), pars_info_get_bound_id(), pars_info_get_bound_lit(), and pars_info_get_user_func().