Drizzled Public API Documentation

type_holder.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 namespace drizzled {
23 
24 /*
25  Item_type_holder used to store type. name, length of Item for UNIONS &
26  derived tables.
27 
28  Item_type_holder do not need cleanup() because its time of live limited by
29  single SP/PS execution.
30 */
31 class Item_type_holder: public Item
32 {
33 protected:
34  TYPELIB *enum_set_typelib;
35  enum_field_types fld_type;
36 
43  void get_full_info(Item *item);
44 
45  /* It is used to count decimal precision in join_types */
46  int prev_decimal_int_part;
47 public:
48  Item_type_holder(Session *session, Item *item);
49 
56  Item_result result_type() const;
57 
58  enum_field_types field_type() const { return fld_type; };
59  enum Type type() const { return TYPE_HOLDER; }
60  double val_real();
61  int64_t val_int();
63  String *val_str(String* val);
64 
77  bool join_types(Session *session, Item *item);
78 
89 
98  static uint32_t display_length(Item *item);
99 
106  static enum_field_types get_real_type(Item *item);
107 };
108 
109 } /* namespace drizzled */
110 
TODO: Rename this file - func.h is stupid.
bool join_types(Session *session, Item *item)
Definition: type_holder.cc:114
Field * make_field_by_type(Table *table)
Definition: type_holder.cc:236
static enum_field_types get_real_type(Item *item)
Definition: type_holder.cc:56
Item_result result_type() const
Definition: type_holder.cc:50
static uint32_t display_length(Item *item)
Definition: type_holder.cc:202
type::Decimal * val_decimal(type::Decimal *val)
Definition: type_holder.cc:305
String * val_str(String *val)
Definition: type_holder.cc:311
void get_full_info(Item *item)
Definition: type_holder.cc:266