~drizzle-trunk/drizzle/development

1089.1.13 by Brian Aker
Sorting methods into class files.
1
/* - mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2008 MySQL
5
 *
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; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 */
20
2234 by Brian Aker
Mass removal of ifdef/endif in favor of pragma once.
21
#pragma once
1241.9.57 by Monty Taylor
Oy. Bigger change than I normally like - but this stuff is all intertwined.
22
2210.3.2 by Olaf van der Spek
Remove dynamic_element
23
#include <cstddef>
24
25
namespace drizzled {
26
27
class DYNAMIC_ARRAY
28
{
29
public:
1089.1.13 by Brian Aker
Sorting methods into class files.
30
  unsigned char *buffer;
2183.2.20 by Olaf van der Spek
Use List::size()
31
  size_t max_element;
1089.1.13 by Brian Aker
Sorting methods into class files.
32
  uint32_t alloc_increment;
33
  uint32_t size_of_element;
2183.2.20 by Olaf van der Spek
Use List::size()
34
2385.3.7 by Olaf van der Spek
Refactor DYNAMIC_ARRAY
35
  unsigned char* alloc();
36
  void free();
37
  void init(uint32_t element_size, uint32_t init_alloc, uint32_t alloc_increment);
2210.3.5 by Olaf van der Spek
Refactor
38
  void push_back(void*);
2210.3.1 by Olaf van der Spek
Remove o
39
2183.2.20 by Olaf van der Spek
Use List::size()
40
  size_t size() const
41
  {
42
    return elements;
43
  }
2221.7.1 by Olaf van der Spek
DYNAMIC_ARRAY::size()
44
45
  void set_size(size_t v)
46
  {
47
    elements = v;
48
  }
49
private:
50
  size_t elements;
2210.3.2 by Olaf van der Spek
Remove dynamic_element
51
};
1089.1.13 by Brian Aker
Sorting methods into class files.
52
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
53
} /* namespace drizzled */