~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/cache.cc

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
22
 
#include <drizzled/field.h>
 
20
#include <drizzled/server_includes.h>
 
21
#include CSTDINT_H
23
22
#include <drizzled/item/cache.h>
24
 
#include <drizzled/item/cache_decimal.h>
 
23
#include <drizzled/item/cache_row.h>
25
24
#include <drizzled/item/cache_int.h>
26
25
#include <drizzled/item/cache_real.h>
27
 
#include <drizzled/item/cache_row.h>
 
26
#include <drizzled/item/cache_decimal.h>
28
27
#include <drizzled/item/cache_str.h>
29
 
#include <drizzled/lex_string.h>
30
 
 
31
 
namespace drizzled
32
 
{
33
28
 
34
29
Item_cache* Item_cache::get_cache(const Item *item)
35
30
{
36
31
  switch (item->result_type()) {
37
32
  case INT_RESULT:
38
33
    return new Item_cache_int();
39
 
 
40
34
  case REAL_RESULT:
41
35
    return new Item_cache_real();
42
 
 
43
36
  case DECIMAL_RESULT:
44
37
    return new Item_cache_decimal();
45
 
 
46
38
  case STRING_RESULT:
47
39
    return new Item_cache_str(item);
48
 
 
49
40
  case ROW_RESULT:
50
41
    return new Item_cache_row();
 
42
  default:
 
43
    // should never be in real life
 
44
    assert(0);
 
45
    return 0;
51
46
  }
52
 
 
53
 
  assert(0);
54
 
  abort();
55
47
}
56
48
 
57
49
 
70
62
  return cached_field ? cached_field->eq_def (field) : false;
71
63
}
72
64
 
73
 
} /* namespace drizzled */