Drizzled Public API Documentation

cache_row.h

00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2008 Sun Microsystems, Inc.
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; version 2 of the License.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  */
00019 
00020 #pragma once
00021 
00022 #include <drizzled/item/cache.h>
00023 
00024 namespace drizzled
00025 {
00026 
00027 class Item_cache;
00028 class Item;
00029 class SendField;
00030 
00031 class Item_cache_row: public Item_cache
00032 {
00033   Item_cache  **values;
00034   uint32_t item_count;
00035   bool save_array;
00036 public:
00037 
00038   Item_cache_row()
00039   :Item_cache(), values(0), item_count(2), save_array(0) {}
00040 
00041   /*
00042     'allocate' used only in row transformer, to preallocate space for row
00043     cache.
00044   */
00045   bool allocate(uint32_t num);
00046   /*
00047     'setup' is needed only by row => it not called by simple row subselect
00048     (only by IN subselect (in subselect optimizer))
00049   */
00050   bool setup(Item *item);
00051   void store(Item *item);
00052   void illegal_method_call(const char * method_name);
00053   void make_field(SendField *field);
00054   double val_real();
00055   int64_t val_int();
00056   String *val_str(String *val);
00057   type::Decimal *val_decimal(type::Decimal *val);
00058 
00059   enum Item_result result_type() const;
00060 
00061   uint32_t cols();
00062   Item *element_index(uint32_t i);
00063   Item **addr(uint32_t i);
00064   bool check_cols(uint32_t c);
00065   bool null_inside();
00066   void bring_value();
00067   void keep_array();
00068   void cleanup();
00069 
00070 };
00071 
00072 } /* namespace drizzled */
00073