1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_SQL_LIST_H
21
#define DRIZZLED_SQL_LIST_H
1
#ifndef INCLUDES_DRIZZLE_SQL_LIST_H
2
#define INCLUDES_DRIZZLE_SQL_LIST_H
3
/* Copyright (C) 2000-2003 MySQL AB
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; version 2 of the License.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
19
#ifdef USE_PRAGMA_INTERFACE
20
#pragma interface /* gcc class implementation */
26
#include <drizzled/sql_alloc.h>
28
25
/** Struct to handle simple linked lists. */
29
26
typedef struct st_sql_list {
34
31
st_sql_list() {} /* Remove gcc warning */
35
32
inline void empty()
67
/* mysql standard class memory allocator */
71
static void *operator new(size_t size) throw ()
73
return sql_alloc(size);
75
static void *operator new[](size_t size)
77
return sql_alloc(size);
79
static void *operator new[](size_t size, MEM_ROOT *mem_root) throw ()
80
{ return alloc_root(mem_root, size); }
81
static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
82
{ return alloc_root(mem_root, size); }
83
static void operator delete(void *ptr __attribute__((unused)),
84
size_t size __attribute__((unused)))
86
static void operator delete(void *ptr __attribute__((unused)),
87
MEM_ROOT *mem_root __attribute__((unused)))
88
{ /* never called */ }
89
static void operator delete[](void *ptr __attribute__((unused)),
90
MEM_ROOT *mem_root __attribute__((unused)))
91
{ /* never called */ }
92
static void operator delete[](void *ptr __attribute__((unused)),
93
size_t size __attribute__((unused)))
97
inline Sql_alloc() :dummy(0) {}
98
inline ~Sql_alloc() {}
100
inline Sql_alloc() {}
101
inline ~Sql_alloc() {}
71
108
Basic single linked list
72
109
Used for item and item_buffs.
442
479
inline void init(List<T> &a) { base_list_iterator::init(a); }
443
480
inline T* operator++(int) { return (T*) base_list_iterator::next_fast(); }
444
481
inline void rewind(void) { base_list_iterator::rewind(); }
445
void sublist(List<T> &list_arg, uint32_t el_arg)
482
void sublist(List<T> &list_arg, uint el_arg)
447
484
base_list_iterator::sublist(list_arg, el_arg);