~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/units.h

  • Committer: Olaf van der Spek
  • Date: 2011-06-27 11:43:28 UTC
  • mto: This revision was merged to the branch mainline in revision 2350.
  • Revision ID: olafvdspek@gmail.com-20110627114328-2adwmfyjakkrlhqn
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <drizzled/function/func.h>
23
23
#include <drizzled/function/math/real.h>
24
24
 
25
 
namespace drizzled
26
 
{
 
25
namespace drizzled {
27
26
 
28
 
class Item_func_units :public Item_real_func
 
27
class Item_func_units : public Item_real_func
29
28
{
30
 
  char *name;
31
 
  double mul,add;
32
29
public:
33
 
  Item_func_units(char *name_arg,Item *a,double mul_arg,double add_arg)
34
 
    :Item_real_func(a),name(name_arg),mul(mul_arg),add(add_arg) {}
 
30
  Item_func_units(const char *name_arg, Item *a, double mul_arg, double add_arg)
 
31
    : Item_real_func(a),name(name_arg),mul(mul_arg),add(add_arg) {}
35
32
  double val_real();
36
33
  const char *func_name() const { return name; }
37
34
  void fix_length_and_dec()
38
35
  { decimals= NOT_FIXED_DEC; max_length= float_length(decimals); }
 
36
private:
 
37
  const char *name;
 
38
  double mul;
 
39
  double add;
39
40
};
40
41
 
41
42
} /* namespace drizzled */