~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/double.h

  • Committer: Lee
  • Date: 2009-01-01 03:07:33 UTC
  • mto: (758.1.3 devel)
  • mto: This revision was merged to the branch mainline in revision 759.
  • Revision ID: lbieber@lbieber-desktop-20090101030733-fb411b55f07vij8q
more header file cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLED_FIELD_DOUBLE_H
22
 
#define DRIZZLED_FIELD_DOUBLE_H
 
21
#ifndef DRIZZLE_SERVER_FIELD_DOUBLE
 
22
#define DRIZZLE_SERVER_FIELD_DOUBLE
23
23
 
24
24
#include <drizzled/field/real.h>
25
25
 
26
 
namespace drizzled
27
 
{
28
 
 
29
26
class Field_double :public Field_real {
30
27
public:
31
 
 
32
 
  using Field::store;
33
 
  using Field::val_int;
34
 
  using Field::val_str;
35
 
  using Field::cmp;
36
 
 
37
28
  Field_double(unsigned char *ptr_arg, uint32_t len_arg,
38
29
               unsigned char *null_ptr_arg,
39
30
               unsigned char null_bit_arg,
45
36
    {}
46
37
  Field_double(uint32_t len_arg, bool maybe_null_arg, const char *field_name_arg,
47
38
               uint8_t dec_arg)
48
 
    :Field_real((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "" : 0, (uint32_t) 0,
 
39
    :Field_real((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "" : 0, (uint) 0,
49
40
                NONE, field_name_arg, dec_arg, 0, 0)
50
41
    {}
51
42
  Field_double(uint32_t len_arg, bool maybe_null_arg, const char *field_name_arg,
52
43
               uint8_t dec_arg, bool not_fixed_arg)
53
 
    :Field_real((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "" : 0, (uint32_t) 0,
 
44
    :Field_real((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "" : 0, (uint) 0,
54
45
                NONE, field_name_arg, dec_arg, 0, 0)
55
46
    {not_fixed= not_fixed_arg; }
56
47
  enum_field_types type() const { return DRIZZLE_TYPE_DOUBLE;}
59
50
  int  store(double nr);
60
51
  int  store(int64_t nr, bool unsigned_val);
61
52
  int reset(void) { memset(ptr, 0, sizeof(double)); return 0; }
62
 
  double val_real(void) const;
63
 
  int64_t val_int(void) const;
64
 
  String *val_str(String*,String *) const;
 
53
  double val_real(void);
 
54
  int64_t val_int(void);
 
55
  String *val_str(String*,String *);
 
56
  bool send_binary(Protocol *protocol);
65
57
  int cmp(const unsigned char *,const unsigned char *);
66
58
  void sort_string(unsigned char *buff,uint32_t length);
67
59
  uint32_t pack_length() const { return sizeof(double); }
 
60
  uint32_t row_pack_length() { return pack_length(); }
68
61
  void sql_type(String &str) const;
 
62
private:
 
63
  int do_save_field_metadata(unsigned char *first_byte);
69
64
};
70
65
 
71
 
} /* namespace drizzled */
72
 
 
73
 
#endif /* DRIZZLED_FIELD_DOUBLE_H */
 
66
#endif
74
67