~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/long.h

  • Committer: Brian Aker
  • Date: 2009-10-15 00:22:33 UTC
  • mto: (1183.1.11 merge)
  • mto: This revision was merged to the branch mainline in revision 1198.
  • Revision ID: brian@gaz-20091015002233-fa4ao2mbc67wls91
First pass of information engine. OMG, ponies... is it so much easier to
deal with creating and engine.

The list table iterator though... its ass, needs to go. We should also
abstract out share. Very few engines need a custom one. Just say'in

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_INT32_H
22
 
#define DRIZZLED_FIELD_INT32_H
 
21
#ifndef DRIZZLE_SERVER_FIELD_LONG
 
22
#define DRIZZLE_SERVER_FIELD_LONG
23
23
 
24
24
#include <drizzled/field/num.h>
25
25
 
26
 
namespace drizzled
27
 
{
28
 
 
29
 
namespace field
30
 
{
31
 
 
32
 
class Int32 :public Field_num {
 
26
class Field_long :public Field_num {
33
27
public:
34
28
 
35
29
  using Field::val_int;
39
33
  using Field::store;
40
34
  using Field::unpack;
41
35
 
42
 
  Int32(unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg,
43
 
        unsigned char null_bit_arg,
44
 
        enum utype unireg_check_arg,
45
 
        const char *field_name_arg) :
46
 
    Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
47
 
              unireg_check_arg, field_name_arg,
48
 
              0, false, false)
49
 
  {}
50
 
 
51
 
  Int32(uint32_t len_arg,bool maybe_null_arg, const char *field_name_arg,
52
 
        bool unsigned_arg) :
53
 
    Field_num((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "": 0,0,
54
 
              NONE, field_name_arg,0,0,unsigned_arg)
55
 
    {}
56
 
 
 
36
  Field_long(unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg,
 
37
             unsigned char null_bit_arg,
 
38
             enum utype unireg_check_arg, const char *field_name_arg,
 
39
             bool zero_arg, bool unsigned_arg)
 
40
    :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
 
41
               unireg_check_arg, field_name_arg,
 
42
               0, zero_arg,unsigned_arg)
 
43
    {}
 
44
  Field_long(uint32_t len_arg,bool maybe_null_arg, const char *field_name_arg,
 
45
             bool unsigned_arg)
 
46
    :Field_num((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "": 0,0,
 
47
               NONE, field_name_arg,0,0,unsigned_arg)
 
48
    {}
57
49
  enum Item_result result_type () const { return INT_RESULT; }
58
50
  enum_field_types type() const { return DRIZZLE_TYPE_LONG;}
59
51
  enum ha_base_keytype key_type() const
60
 
  { return unsigned_flag ? HA_KEYTYPE_ULONG_INT : HA_KEYTYPE_LONG_INT; }
 
52
    { return unsigned_flag ? HA_KEYTYPE_ULONG_INT : HA_KEYTYPE_LONG_INT; }
61
53
  int store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
62
54
  int store(double nr);
63
55
  int store(int64_t nr, bool unsigned_val);
71
63
  void sql_type(String &str) const;
72
64
  uint32_t max_display_length() { return MY_INT32_NUM_DECIMAL_DIGITS; }
73
65
  virtual unsigned char *pack(unsigned char* to, const unsigned char *from,
74
 
                              uint32_t max_length,
 
66
                      uint32_t max_length,
 
67
                      bool low_byte_first);
 
68
 
 
69
  virtual const unsigned char *unpack(unsigned char* to, const unsigned char *from,
 
70
                              uint32_t param_data,
75
71
                              bool low_byte_first);
76
 
 
77
 
  virtual const unsigned char *unpack(unsigned char* to, const unsigned char *from,
78
 
                                      uint32_t param_data,
79
 
                                      bool low_byte_first);
80
72
};
81
73
 
82
 
} /* namespace field */
83
 
} /* namespace drizzled */
84
 
 
85
 
#endif /* DRIZZLED_FIELD_INT32_H */
 
74
#endif
86
75