~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/units.h

  • Committer: Mark Atwood
  • Date: 2011-08-11 03:05:03 UTC
  • mfrom: (2385.1.12 refactor4)
  • Revision ID: me@mark.atwood.name-20110811030503-rp9xjihc5x3y0x4q
mergeĀ lp:~olafvdspek/drizzle/refactor4

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_FUNCTION_UNITS_H
21
 
#define DRIZZLED_FUNCTION_UNITS_H
 
20
#pragma once
22
21
 
23
22
#include <drizzled/function/func.h>
24
23
#include <drizzled/function/math/real.h>
25
24
 
26
 
namespace drizzled
27
 
{
 
25
namespace drizzled {
28
26
 
29
 
class Item_func_units :public Item_real_func
 
27
class Item_func_units : public Item_real_func
30
28
{
31
 
  char *name;
32
 
  double mul,add;
33
29
public:
34
 
  Item_func_units(char *name_arg,Item *a,double mul_arg,double add_arg)
35
 
    :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) {}
36
32
  double val_real();
37
33
  const char *func_name() const { return name; }
38
34
  void fix_length_and_dec()
39
35
  { decimals= NOT_FIXED_DEC; max_length= float_length(decimals); }
 
36
private:
 
37
  const char *name;
 
38
  double mul;
 
39
  double add;
40
40
};
41
41
 
42
42
} /* namespace drizzled */
43
43
 
44
 
#endif /* DRIZZLED_FUNCTION_UNITS_H */