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
/****************************************************************/
100
UNIV_INLINE
101
void
*
102
ib_vector_get_last
(
103
/*===============*/
104
ib_vector_t
* vec);
106
/****************************************************************/
108
UNIV_INLINE
109
void
110
ib_vector_set
(
111
/*==========*/
112
ib_vector_t
* vec,
113
ulint n,
114
void
* elem);
116
/****************************************************************/
118
UNIV_INLINE
119
void
*
120
ib_vector_pop
(
121
/*==========*/
122
ib_vector_t
* vec);
124
/****************************************************************/
127
UNIV_INLINE
128
void
129
ib_vector_free
(
130
/*===========*/
131
ib_vector_t
* vec);
134
struct
ib_vector_struct
{
135
mem_heap_t
*
heap
;
136
void
**
data
;
137
ulint
used
;
138
ulint
total
;
139
};
140
141
#ifndef UNIV_NONINL
142
#include "ut0vec.ic"
143
#endif
144
145
#endif
plugin
innobase
include
ut0vec.h
Generated on Tue Oct 29 2013 17:05:47 for drizzle by
1.8.4