InnoDB Plugin  1.0
Functions
ut0bh.ic File Reference
#include "ut0bh.h"
#include "ut0mem.h"
Include dependency graph for ut0bh.ic:
This graph shows which files directly or indirectly include this file:

Functions

UNIV_INLINE ulint ib_bh_size (const ib_bh_t *ib_bh)
UNIV_INLINE ibool ib_bh_is_empty (const ib_bh_t *ib_bh)
UNIV_INLINE ibool ib_bh_is_full (const ib_bh_t *ib_bh)
UNIV_INLINE void * ib_bh_get (ib_bh_t *ib_bh, ulint i)
UNIV_INLINE void * ib_bh_set (ib_bh_t *ib_bh, ulint i, const void *elem)
UNIV_INLINE void * ib_bh_first (ib_bh_t *ib_bh)
UNIV_INLINE void * ib_bh_last (ib_bh_t *ib_bh)

Detailed Description

Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA

Binary min-heap implementation.

Created 2011-01-15 by Sunny Bains

Function Documentation

UNIV_INLINE void* ib_bh_first ( ib_bh_t ib_bh)

Return the first element from the binary heap.

Returns
pointer to first element or NULL if empty.
Parameters
ib_bhin: instance
UNIV_INLINE void* ib_bh_get ( ib_bh_t ib_bh,
ulint  i 
)

Get a pointer to the element.

Returns
pointer to element
Parameters
ib_bhin: instance
iin: index
UNIV_INLINE ibool ib_bh_is_empty ( const ib_bh_t ib_bh)

Test if binary heap is empty.

Returns
TRUE if empty.
Parameters
ib_bhin: instance
UNIV_INLINE ibool ib_bh_is_full ( const ib_bh_t ib_bh)

Test if binary heap is full.

Returns
TRUE if full.
Parameters
ib_bhin: instance
UNIV_INLINE void* ib_bh_last ( ib_bh_t ib_bh)

Return the last element from the binary heap.

Returns
pointer to last element or NULL if empty.
Parameters
ib_bhin/out: instance
UNIV_INLINE void* ib_bh_set ( ib_bh_t ib_bh,
ulint  i,
const void *  elem 
)

Copy an element to the binary heap.

Returns
pointer to copied element
Parameters
ib_bhin/out: instance
iin: index
elemin: element to add
UNIV_INLINE ulint ib_bh_size ( const ib_bh_t ib_bh)

Get the number of elements in the binary heap.

Returns
number of elements
Parameters
ib_bhin: instance