~drizzle-trunk/drizzle/development

584.4.10 by Monty Taylor
Broke out cached_item.
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
584.4.10 by Monty Taylor
Broke out cached_item.
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; version 2 of the License.
9
 *
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.
14
 *
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
18
 */
19
2234 by Brian Aker
Mass removal of ifdef/endif in favor of pragma once.
20
#pragma once
584.4.10 by Monty Taylor
Broke out cached_item.
21
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
22
#include <drizzled/memory/sql_alloc.h>
23
#include <drizzled/sql_string.h>
24
#include <drizzled/type/decimal.h>
584.4.10 by Monty Taylor
Broke out cached_item.
25
2252.1.12 by Olaf van der Spek
Common fwd
26
namespace drizzled {
584.4.10 by Monty Taylor
Broke out cached_item.
27
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
28
class Cached_item :public memory::SqlAlloc
584.4.10 by Monty Taylor
Broke out cached_item.
29
{
30
public:
31
  bool null_value;
32
  Cached_item() :null_value(0) {}
33
  virtual bool cmp(void)=0;
34
  virtual ~Cached_item(); /*line -e1509 */
35
};
36
37
class Cached_item_str :public Cached_item
38
{
39
  Item *item;
40
  String value,tmp_value;
41
public:
42
  Cached_item_str(Session *session, Item *arg);
43
  bool cmp(void);
44
  ~Cached_item_str();                           // Deallocate String:s
45
};
46
47
48
class Cached_item_real :public Cached_item
49
{
50
  Item *item;
51
  double value;
52
public:
53
  Cached_item_real(Item *item_par) :item(item_par),value(0.0) {}
54
  bool cmp(void);
55
};
56
57
class Cached_item_int :public Cached_item
58
{
59
  Item *item;
60
  int64_t value;
61
public:
62
  Cached_item_int(Item *item_par) :item(item_par),value(0) {}
63
  bool cmp(void);
64
};
65
66
67
class Cached_item_decimal :public Cached_item
68
{
69
  Item *item;
2030.1.4 by Brian Aker
Change my_decimal to Decimal
70
  type::Decimal value;
584.4.10 by Monty Taylor
Broke out cached_item.
71
public:
72
  Cached_item_decimal(Item *item_par);
73
  bool cmp(void);
74
};
75
76
class Cached_item_field :public Cached_item
77
{
78
  unsigned char *buff;
79
  Field *field;
80
  uint32_t length;
81
82
public:
1237.9.4 by Padraig O'Sullivan
Removed the inclusion of drizzled/field.h in the server_includes header file.
83
  Cached_item_field(Field *arg_field);
584.4.10 by Monty Taylor
Broke out cached_item.
84
  bool cmp(void);
85
};
86
1221.1.1 by Jay Pipes
Fixes some valgrind warnings regarding conditionals depending on unintialized variables. Use initializer lists properly, dang it. :) Also, removed the new_Cached_item() function's use_result_field, as this was only used for views and was producing a valgrind warning unnecessarily.
87
Cached_item *new_Cached_item(Session *session, Item *item);
584.4.10 by Monty Taylor
Broke out cached_item.
88
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
89
} /* namespace drizzled */
90