Drizzled Public API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ut0vec.h
Go to the documentation of this file.
1
/*****************************************************************************
2
3
Copyright (C) 2006, 2009, Innobase Oy. All Rights Reserved.
4
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
8
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
St, Fifth Floor, Boston, MA 02110-1301 USA
16
17
*****************************************************************************/
18
19
/*******************************************************************/
26
#pragma once
27
#ifndef IB_VECTOR_H
28
#define IB_VECTOR_H
29
30
#include "univ.i"
31
#include "
mem0mem.h
"
32
34
typedef
struct
ib_vector_struct
ib_vector_t
;
35
36
/* An automatically resizing vector datatype with the following properties:
37
38
-Contains void* items.
39
40
-The items are owned by the caller.
41
42
-All memory allocation is done through a heap owned by the caller, who is
43
responsible for freeing it when done with the vector.
44
45
-When the vector is resized, the old memory area is left allocated since it
46
uses the same heap as the new memory area, so this is best used for
47
relatively small or short-lived uses.
48
*/
49
50
/****************************************************************/
53
UNIV_INTERN
54
ib_vector_t
*
55
ib_vector_create
(
56
/*=============*/
57
mem_heap_t
*
heap
,
58
ulint size);
60
/****************************************************************/
62
UNIV_INTERN
63
void
64
ib_vector_push
(
65
/*===========*/
66
ib_vector_t
* vec,
67
void
* elem);
69
/****************************************************************/
72
UNIV_INLINE
73
ulint
74
ib_vector_size
(
75
/*===========*/
76
const
ib_vector_t
* vec);
78
/****************************************************************/
81
UNIV_INLINE
82
ibool
83
ib_vector_is_empty
(
84
/*===============*/
85
const
ib_vector_t
* vec);
87
/****************************************************************/
90
UNIV_INLINE
91
void
*
92
ib_vector_get
(
93
/*==========*/
94
ib_vector_t
* vec,
95
ulint n);
97
/****************************************************************/
99
UNIV_INLINE
100
void
*
101
ib_vector_pop
(
102
/*==========*/
103
ib_vector_t
* vec);
105
/****************************************************************/
108
UNIV_INLINE
109
void
110
ib_vector_free
(
111
/*===========*/
112
ib_vector_t
* vec);
115
struct
ib_vector_struct
{
116
mem_heap_t
*
heap
;
117
void
**
data
;
118
ulint
used
;
119
ulint
total
;
120
};
121
122
#ifndef UNIV_NONINL
123
#include "ut0vec.ic"
124
#endif
125
126
#endif
plugin
innobase
include
ut0vec.h
Generated on Wed Aug 21 2013 20:36:50 for drizzle by
1.8.4