~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/protocol.h

  • Committer: Brian Aker
  • Date: 2008-11-18 23:19:19 UTC
  • mfrom: (584.1.16 devel)
  • Revision ID: brian@tangent.org-20081118231919-w9sr347dtiwhccml
Merge of Monty's work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_PROTOCOL_H
21
21
#define DRIZZLED_PROTOCOL_H
22
22
 
 
23
#include <drizzled/sql_list.h>
 
24
#include <drizzled/item.h>
 
25
 
 
26
class Field;
 
27
class String;
23
28
class i_string;
24
29
class Session;
 
30
class my_decimal;
25
31
typedef struct st_drizzle_field DRIZZLE_FIELD;
26
32
typedef struct st_drizzle_rows DRIZZLE_ROWS;
 
33
typedef struct st_drizzle_time DRIZZLE_TIME;
27
34
 
28
35
class Protocol
29
36
{
50
57
  bool store(I_List<i_string> *str_list);
51
58
  bool store(const char *from, const CHARSET_INFO * const cs);
52
59
  String *storage_packet() { return packet; }
53
 
  inline void free() { packet->free(); }
 
60
  void free();
54
61
  virtual bool write();
55
62
  inline  bool store(int from)
56
63
  { return store_long((int64_t) from); }
60
67
  { return store_int64_t((int64_t) from, 0); }
61
68
  inline  bool store(uint64_t from)
62
69
  { return store_int64_t((int64_t) from, 1); }
63
 
  inline bool store(String *str)
64
 
  { return store((char*) str->ptr(), str->length(), str->charset()); }
 
70
  bool store(String *str);
65
71
 
66
 
  virtual bool prepare_for_send(List<Item> *item_list) 
 
72
  virtual bool prepare_for_send(List<Item> *item_list)
67
73
  {
68
74
    field_count=item_list->elements;
69
75
    return 0;
77
83
  virtual bool store_short(int64_t from)=0;
78
84
  virtual bool store_long(int64_t from)=0;
79
85
  virtual bool store_int64_t(int64_t from, bool unsigned_flag)=0;
80
 
  virtual bool store_decimal(const my_decimal *)=0;
 
86
  virtual bool store_decimal(const my_decimal * dec_value)=0;
81
87
  virtual bool store(const char *from, size_t length, const CHARSET_INFO * const cs)=0;
82
88
  virtual bool store(const char *from, size_t length, 
83
89
                     const CHARSET_INFO * const fromcs, const CHARSET_INFO * const tocs)=0;