~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/function/boolean.h

Merge Stewart's dead code removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2010 Brian Aker
5
 
 *  Copyright (C) 2010 Brian Aker
6
 
 *
7
 
 *  This program is free software; you can redistribute it and/or modify
8
 
 *  it under the terms of the GNU General Public License as published by
9
 
 *  the Free Software Foundation; either version 2 of the License, or
10
 
 *  (at your option) any later version.
11
 
 *
12
 
 *  This program is distributed in the hope that it will be useful,
13
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 *  GNU General Public License for more details.
16
 
 *
17
 
 *  You should have received a copy of the GNU General Public License
18
 
 *  along with this program; if not, write to the Free Software
19
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
 
 */
21
 
 
22
 
 
23
 
#ifndef DRIZZLED_ITEM_FUNCTION_BOOLEAN_H
24
 
#define DRIZZLED_ITEM_FUNCTION_BOOLEAN_H
25
 
 
26
 
#include "drizzled/function/math/int.h"
27
 
 
28
 
namespace drizzled
29
 
{
30
 
 
31
 
namespace item
32
 
{
33
 
 
34
 
namespace function
35
 
{
36
 
 
37
 
class Boolean :public Item_int_func
38
 
{
39
 
public:
40
 
  Boolean() :
41
 
    Item_int_func()
42
 
  {}
43
 
 
44
 
  Boolean(Item *a) :
45
 
    Item_int_func(a)
46
 
  {}
47
 
 
48
 
  Boolean(Item *a,Item *b) :
49
 
    Item_int_func(a,b)
50
 
  {}
51
 
 
52
 
  Boolean(Session *session, Boolean *item) :
53
 
    Item_int_func(session, item)
54
 
  {}
55
 
 
56
 
  bool is_bool_func()
57
 
  {
58
 
    return true;
59
 
  }
60
 
 
61
 
  void fix_length_and_dec()
62
 
  {
63
 
    decimals= 0;
64
 
    max_length= 1;
65
 
  }
66
 
 
67
 
  uint32_t decimal_precision() const
68
 
  {
69
 
    return 1;
70
 
  }
71
 
};
72
 
 
73
 
} /* namespace function */
74
 
} /* namespace item */
75
 
} /* namespace drizzled */
76
 
 
77
 
#endif /* DRIZZLED_ITEM_FUNCTION_BOOLEAN_H */