~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/stored_key.h

  • Committer: Brian Aker
  • Date: 2011-02-12 06:56:00 UTC
  • mto: This revision was merged to the branch mainline in revision 2161.
  • Revision ID: brian@tangent.org-20110212065600-m6c68fybw51rflhj
Further strip out includes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_STORED_KEY_H
21
21
#define DRIZZLED_STORED_KEY_H
22
22
 
 
23
#include <drizzled/memory/sql_alloc.h>
 
24
#include <drizzled/copy_field.h>
 
25
 
23
26
namespace drizzled
24
27
{
25
28
 
 
29
class Field;
 
30
class Session;
 
31
class Item;
 
32
 
26
33
/** class to store an field/item as a key struct */
27
34
class StoredKey :public memory::SqlAlloc
28
35
{
34
41
    STORE_KEY_FATAL, 
35
42
    STORE_KEY_CONV 
36
43
  };
 
44
 
37
45
protected:
38
46
  Field *to_field;                              // Store data here
39
47
  unsigned char *null_ptr;
40
48
  unsigned char err;
41
49
  virtual enum store_key_result copy_inner()=0;
 
50
 
42
51
public:
43
52
  StoredKey(Session *session,
44
53
            Field *field_arg, 
67
76
public:
68
77
  store_key_field(Session *session, Field *to_field_arg, unsigned char *ptr,
69
78
                  unsigned char *null_ptr_arg,
70
 
                  uint32_t length, Field *from_field, const char *name_arg)
71
 
    :StoredKey(session, to_field_arg,ptr,
72
 
               null_ptr_arg ? null_ptr_arg : from_field->maybe_null() ? &err
73
 
               : (unsigned char*) 0, length), field_name(name_arg)
74
 
  {
 
79
                  uint32_t length, Field *from_field, const char *name_arg) :
 
80
    StoredKey(session, to_field_arg,ptr,
 
81
              null_ptr_arg ? null_ptr_arg : from_field->maybe_null() ? &err
 
82
              : (unsigned char*) 0, length), field_name(name_arg)
 
83
    {
75
84
    if (to_field)
76
85
    {
77
86
      copy_field.set(to_field,from_field,0);
90
99
 
91
100
class store_key_item :public StoredKey
92
101
{
93
 
 protected:
 
102
protected:
94
103
  Item *item;
 
104
 
95
105
public:
96
106
  store_key_item(Session *session, Field *to_field_arg, unsigned char *ptr,
97
107
                 unsigned char *null_ptr_arg, uint32_t length, Item *item_arg) :
113
123
class store_key_const_item :public store_key_item
114
124
{
115
125
  bool inited;
 
126
 
116
127
public:
117
128
  store_key_const_item(Session *session, Field *to_field_arg, unsigned char *ptr,
118
 
                       unsigned char *null_ptr_arg, uint32_t length,
119
 
                       Item *item_arg) :
 
129
                       unsigned char *null_ptr_arg, uint32_t length,
 
130
                       Item *item_arg) :
120
131
    store_key_item(session, to_field_arg,ptr,
121
132
                   null_ptr_arg ? null_ptr_arg : item_arg->maybe_null ?
122
133
                   &err : (unsigned char*) 0, length, item_arg), inited(0)