~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
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
26
namespace drizzled
27
{
28
584.4.10 by Monty Taylor
Broke out cached_item.
29
class Item;
30
class Session;
1237.9.4 by Padraig O'Sullivan
Removed the inclusion of drizzled/field.h in the server_includes header file.
31
class Field;
584.4.10 by Monty Taylor
Broke out cached_item.
32
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
33
class Cached_item :public memory::SqlAlloc
584.4.10 by Monty Taylor
Broke out cached_item.
34
{
35
public:
36
  bool null_value;
37
  Cached_item() :null_value(0) {}
38
  virtual bool cmp(void)=0;
39
  virtual ~Cached_item(); /*line -e1509 */
40
};
41
42
class Cached_item_str :public Cached_item
43
{
44
  Item *item;
45
  String value,tmp_value;
46
public:
47
  Cached_item_str(Session *session, Item *arg);
48
  bool cmp(void);
49
  ~Cached_item_str();                           // Deallocate String:s
50
};
51
52
53
class Cached_item_real :public Cached_item
54
{
55
  Item *item;
56
  double value;
57
public:
58
  Cached_item_real(Item *item_par) :item(item_par),value(0.0) {}
59
  bool cmp(void);
60
};
61
62
class Cached_item_int :public Cached_item
63
{
64
  Item *item;
65
  int64_t value;
66
public:
67
  Cached_item_int(Item *item_par) :item(item_par),value(0) {}
68
  bool cmp(void);
69
};
70
71
72
class Cached_item_decimal :public Cached_item
73
{
74
  Item *item;
2030.1.4 by Brian Aker
Change my_decimal to Decimal
75
  type::Decimal value;
584.4.10 by Monty Taylor
Broke out cached_item.
76
public:
77
  Cached_item_decimal(Item *item_par);
78
  bool cmp(void);
79
};
80
81
class Cached_item_field :public Cached_item
82
{
83
  unsigned char *buff;
84
  Field *field;
85
  uint32_t length;
86
87
public:
1237.9.4 by Padraig O'Sullivan
Removed the inclusion of drizzled/field.h in the server_includes header file.
88
  Cached_item_field(Field *arg_field);
584.4.10 by Monty Taylor
Broke out cached_item.
89
  bool cmp(void);
90
};
91
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.
92
Cached_item *new_Cached_item(Session *session, Item *item);
584.4.10 by Monty Taylor
Broke out cached_item.
93
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
94
} /* namespace drizzled */
95