drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
cached_item.h
1/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2008 Sun Microsystems, Inc.
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
20#pragma once
21
22#include <drizzled/memory/sql_alloc.h>
23#include <drizzled/sql_string.h>
24#include <drizzled/type/decimal.h>
25
26namespace drizzled {
27
28class Cached_item :public memory::SqlAlloc
29{
30public:
31 bool null_value;
32 Cached_item() :null_value(0) {}
33 virtual bool cmp(void)=0;
34 virtual ~Cached_item(); /*line -e1509 */
35};
36
37class Cached_item_str :public Cached_item
38{
39 Item *item;
40 String value,tmp_value;
41public:
42 Cached_item_str(Session *session, Item *arg);
43 bool cmp(void);
44 ~Cached_item_str(); // Deallocate String:s
45};
46
47
48class Cached_item_real :public Cached_item
49{
50 Item *item;
51 double value;
52public:
53 Cached_item_real(Item *item_par) :item(item_par),value(0.0) {}
54 bool cmp(void);
55};
56
57class Cached_item_int :public Cached_item
58{
59 Item *item;
60 int64_t value;
61public:
62 Cached_item_int(Item *item_par) :item(item_par),value(0) {}
63 bool cmp(void);
64};
65
66
67class Cached_item_decimal :public Cached_item
68{
69 Item *item;
70 type::Decimal value;
71public:
72 Cached_item_decimal(Item *item_par);
73 bool cmp(void);
74};
75
76class Cached_item_field :public Cached_item
77{
78 unsigned char *buff;
79 Field *field;
80 uint32_t length;
81
82public:
83 Cached_item_field(Field *arg_field);
84 bool cmp(void);
85};
86
87Cached_item *new_Cached_item(Session *session, Item *item);
88
89} /* namespace drizzled */
90
Cached_item_str(Session *session, Item *arg)
TODO: Rename this file - func.h is stupid.
Cached_item * new_Cached_item(Session *session, Item *item)