Drizzled Public API Documentation

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 
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
56 /*=============*/
57  mem_heap_t* heap,
58  ulint size);
60 /****************************************************************/
62 UNIV_INTERN
63 void
65 /*===========*/
66  ib_vector_t* vec,
67  void* elem);
69 /****************************************************************/
72 UNIV_INLINE
73 ulint
75 /*===========*/
76  const ib_vector_t* vec);
78 /****************************************************************/
81 UNIV_INLINE
82 ibool
84 /*===============*/
85  const ib_vector_t* vec);
87 /****************************************************************/
90 UNIV_INLINE
91 void*
93 /*==========*/
94  ib_vector_t* vec,
95  ulint n);
97 /****************************************************************/
99 UNIV_INLINE
100 void*
102 /*==========*/
103  ib_vector_t* vec);
105 /****************************************************************/
108 UNIV_INLINE
109 void
111 /*===========*/
112  ib_vector_t* vec);
117  void** data;
118  ulint used;
119  ulint total;
120 };
121 
122 #ifndef UNIV_NONINL
123 #include "ut0vec.ic"
124 #endif
125 
126 #endif