~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field_iterator.h

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifdef USE_PRAGMA_INTERFACE
2
 
#pragma interface                       /* gcc class implementation */
3
 
#endif
 
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
 *
 
4
 *  Copyright (C) 2008 Sun Microsystems
 
5
 *
 
6
 *  This program is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation; version 2 of the License.
 
9
 *
 
10
 *  This program is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with this program; if not, write to the Free Software
 
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
18
 */
4
19
 
5
20
 
6
21
#ifndef DRIZZLED_FIELD_ITERATOR_H
7
22
#define DRIZZLED_FIELD_ITERATOR_H
8
23
 
 
24
#include <drizzled/sql_alloc.h>
 
25
#include <drizzled/sql_list.h>
 
26
 
9
27
class Table;
10
28
class TableList;
11
29
 
22
40
  virtual void next()= 0;
23
41
  virtual bool end_of_fields()= 0;              /* Return 1 at end of list */
24
42
  virtual const char *name()= 0;
25
 
  virtual Item *create_item(THD *)= 0;
 
43
  virtual Item *create_item(Session *)= 0;
26
44
  virtual Field *field()= 0;
27
45
};
28
46
 
42
60
  void next() { ptr++; }
43
61
  bool end_of_fields() { return *ptr == 0; }
44
62
  const char *name();
45
 
  Item *create_item(THD *thd);
 
63
  Item *create_item(Session *session);
46
64
  Field *field() { return *ptr; }
47
65
};
48
66
 
65
83
  void next();
66
84
  bool end_of_fields() { return !cur_column_ref; }
67
85
  const char *name() { return cur_column_ref->name(); }
68
 
  Item *create_item(THD *thd) { return cur_column_ref->create_item(thd); }
 
86
  Item *create_item(Session *session) { return cur_column_ref->create_item(session); }
69
87
  Field *field() { return cur_column_ref->field(); }
70
88
  Natural_join_column *column_ref() { return cur_column_ref; }
71
89
};
103
121
  const char *name() { return field_it->name(); }
104
122
  const char *table_name();
105
123
  const char *db_name();
106
 
  Item *create_item(THD *thd) { return field_it->create_item(thd); }
 
124
  Item *create_item(Session *session) { return field_it->create_item(session); }
107
125
  Field *field() { return field_it->field(); }
108
126
  Natural_join_column *get_or_create_column_ref(TableList *parent_table_ref);
109
127
  Natural_join_column *get_natural_column_ref();