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_CACHED_ITEM_H
21
#define DRIZZLED_CACHED_ITEM_H
23
#include <drizzled/sql_alloc.h>
24
#include <drizzled/sql_string.h>
29
class Cached_item :public Sql_alloc
33
Cached_item() :null_value(0) {}
34
virtual bool cmp(void)=0;
35
virtual ~Cached_item(); /*line -e1509 */
38
class Cached_item_str :public Cached_item
41
String value,tmp_value;
43
Cached_item_str(Session *session, Item *arg);
45
~Cached_item_str(); // Deallocate String:s
49
class Cached_item_real :public Cached_item
54
Cached_item_real(Item *item_par) :item(item_par),value(0.0) {}
58
class Cached_item_int :public Cached_item
63
Cached_item_int(Item *item_par) :item(item_par),value(0) {}
68
class Cached_item_decimal :public Cached_item
73
Cached_item_decimal(Item *item_par);
77
class Cached_item_field :public Cached_item
84
Cached_item_field(Field *arg_field) : field(arg_field)
87
/* TODO: take the memory allocation below out of the constructor. */
88
buff= (unsigned char*) sql_calloc(length=field->pack_length());
93
Cached_item *new_Cached_item(Session *session, Item *item,
94
bool use_result_field);
96
#endif /* DRIZZLED_CACHED_ITEM_H */