Drizzled Public API Documentation

user_var_entry.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 
21 #pragma once
22 
23 #include <drizzled/dtcollation.h>
24 #include <drizzled/item_result.h>
25 
26 namespace drizzled {
27 
29 {
30 public:
31  user_var_entry(const char*, query_id_t id) :
32  value(NULL),
33  length(0),
34  size(0),
35  update_query_id(0),
36  used_query_id(id),
37  type(STRING_RESULT),
38  unsigned_flag(false),
39  collation(NULL, DERIVATION_IMPLICIT)
40  {
41  }
42 
44  {
45  free(value);
46  }
47 
48  char* value;
49  ulong length;
50  size_t size;
51  query_id_t update_query_id;
52  query_id_t used_query_id;
53  Item_result type;
54  bool unsigned_flag;
55  DTCollation collation;
56 
57  double val_real(bool *null_value) const;
58  int64_t val_int(bool *null_value) const;
59  String *val_str(bool *null_value, String*, uint32_t decimals) const;
60  type::Decimal *val_decimal(bool *null_value, type::Decimal *result) const;
61 
62  void update_hash(bool set_null, data_ref, Item_result type, const charset_info_st* cs, Derivation dv, bool unsigned_arg);
63 };
64 
65 } /* namespace drizzled */
66