InnoDB Plugin  1.0
Data Structures | Macros | Typedefs | Functions
ut0vec.h File Reference
#include "univ.i"
#include "mem0mem.h"
#include "ut0vec.ic"
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.

Data Structures

struct  ib_alloc_t
struct  ib_vector_t

Macros

#define ib_vector_getp(v, n)   (*(void**) ib_vector_get(v, n))
#define ib_vector_getp_const(v, n)   (*(void**) ib_vector_get_const(v, n))
#define ib_vector_allocator(v)   (v->allocator)

Typedefs

typedef void *(* ib_mem_alloc_t )(ib_alloc_t *allocator, ulint size)
typedef void(* ib_mem_free_t )(ib_alloc_t *allocator, void *ptr)
typedef void *(* ib_mem_resize_t )(ib_alloc_t *allocator, void *ptr, ulint old_size, ulint new_size)
typedef int(* ib_compare_t )(const void *, const void *)

Functions

UNIV_INTERN ib_vector_tib_vector_create (ib_alloc_t *alloc, ulint sizeof_value, ulint size)
UNIV_INLINE void ib_vector_free (ib_vector_t *vec)
UNIV_INLINE void * ib_vector_push (ib_vector_t *vec, const void *elem)
UNIV_INLINE void * ib_vector_pop (ib_vector_t *vec)
UNIV_INLINE void * ib_vector_remove (ib_vector_t *vec, const void *elem)
UNIV_INLINE ulint ib_vector_size (const ib_vector_t *vec)
UNIV_INTERN void ib_vector_resize (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 const void * ib_vector_get_const (const 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_reset (ib_vector_t *vec)
UNIV_INLINE void * ib_vector_last (ib_vector_t *vec)
UNIV_INLINE const void * ib_vector_last_const (const ib_vector_t *vec)
UNIV_INLINE void ib_vector_sort (ib_vector_t *vec, ib_compare_t compare)
UNIV_INLINE void ib_heap_free (ib_alloc_t *allocator, void *ptr)
UNIV_INLINE void * ib_heap_malloc (ib_alloc_t *allocator, ulint size)
UNIV_INLINE void * ib_heap_resize (ib_alloc_t *allocator, void *old_ptr, ulint old_size, ulint new_size)
UNIV_INLINE ib_alloc_tib_heap_allocator_create (mem_heap_t *heap)
UNIV_INLINE void ib_heap_allocator_free (ib_alloc_t *ib_ut_alloc)
UNIV_INLINE void ib_ut_free (ib_alloc_t *allocator, void *ptr)
UNIV_INLINE void * ib_ut_malloc (ib_alloc_t *allocator, ulint size)
UNIV_INLINE void * ib_ut_resize (ib_alloc_t *allocator, void *old_ptr, ulint old_size, ulint new_size)
UNIV_INLINE ib_alloc_tib_ut_allocator_create (void)
UNIV_INLINE void ib_ut_allocator_free (ib_alloc_t *ib_ut_alloc)

Detailed Description

A vector of pointers to data items

Created 4/6/2006 Osku Salerma

Function Documentation

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

Get n'th element.

Parameters
vecin: vector
nin: element index to get
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

Get last element. The vector must not be empty.

Returns
last element
Parameters
vecin: vector
UNIV_INLINE ibool ib_vector_is_empty ( const ib_vector_t vec)

in: vector

Parameters
vecin: vector
UNIV_INLINE void* ib_vector_pop ( ib_vector_t vec)

Remove the last element from the vector.

Returns
last vector element
UNIV_INLINE void* ib_vector_remove ( ib_vector_t vec,
const void *  elem 
)

Remove an element to the vector

Returns
pointer to the "removed" element in: value to remove

Remove an element to the vector

Returns
pointer to the "removed" element
Parameters
vecin: vector
elemin: value to remove
UNIV_INLINE void ib_vector_set ( ib_vector_t vec,
ulint  n,
void *  elem 
)

Set the n'th element. in: data element

Set the n'th element.

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