Drizzled Public API Documentation

boolean.h
00001 /* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2010 Brian Aker
00005  *  Copyright (C) 2010 Brian Aker
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020  */
00021 
00022 
00023 #pragma once
00024 
00025 #include <drizzled/function/math/int.h>
00026 
00027 namespace drizzled
00028 {
00029 
00030 namespace item
00031 {
00032 
00033 namespace function
00034 {
00035 
00036 class Boolean :public Item_int_func
00037 {
00038 public:
00039   Boolean() :
00040     Item_int_func()
00041   {}
00042 
00043   Boolean(Item *a) :
00044     Item_int_func(a)
00045   {}
00046 
00047   Boolean(Item *a,Item *b) :
00048     Item_int_func(a,b)
00049   {}
00050 
00051   Boolean(Session *session, Boolean *item) :
00052     Item_int_func(session, item)
00053   {}
00054 
00055   bool is_bool_func()
00056   {
00057     return true;
00058   }
00059 
00060   void fix_length_and_dec()
00061   {
00062     decimals= 0;
00063     max_length= 1;
00064   }
00065 
00066   uint32_t decimal_precision() const
00067   {
00068     return 1;
00069   }
00070 };
00071 
00072 } /* namespace function */
00073 } /* namespace item */
00074 } /* namespace drizzled */
00075