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_ITEM_FLOAT_H
21
#define DRIZZLED_ITEM_FLOAT_H
23
class Item_float :public Item_num
28
// Item_real() :value(0) {}
29
Item_float(const char *str_arg, uint32_t length);
30
Item_float(const char *str,double val_arg,uint32_t decimal_par,uint32_t length)
33
presentation= name=(char*) str;
34
decimals=(uint8_t) decimal_par;
38
Item_float(double value_par, uint32_t decimal_par) :presentation(0), value(value_par)
40
decimals= (uint8_t) decimal_par;
43
int save_in_field(Field *field, bool no_conversions);
44
enum Type type() const { return REAL_ITEM; }
45
enum_field_types field_type() const { return DRIZZLE_TYPE_DOUBLE; }
46
double val_real() { assert(fixed == 1); return value; }
48
String *val_str(String*);
49
my_decimal *val_decimal(my_decimal *);
50
bool basic_const_item() const { return 1; }
52
{ return new Item_float(name, value, decimals, max_length); }
53
Item_num *neg() { value= -value; return this; }
54
virtual void print(String *str, enum_query_type query_type);
55
bool eq(const Item *, bool binary_cmp) const;
58
class Item_static_float_func :public Item_float
60
const char *func_name;
62
Item_static_float_func(const char *str, double val_arg, uint32_t decimal_par,
64
:Item_float(NULL, val_arg, decimal_par, length), func_name(str)
67
virtual inline void print(String *str, enum_query_type)
69
str->append(func_name);
72
Item *safe_charset_converter(const CHARSET_INFO * const tocs);
73
bool check_vcol_func_processor(unsigned char *)
77
#endif /* DRIZZLED_ITEM_FLOAT_H */