~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field_iterator.h

  • Committer: Mark Atwood
  • Date: 2008-10-03 01:39:40 UTC
  • mto: This revision was merged to the branch mainline in revision 437.
  • Revision ID: mark@fallenpegasus.com-20081003013940-mvefjo725dltz41h
rename logging_noop to logging_query

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
 */
 
1
#ifdef USE_PRAGMA_INTERFACE
 
2
#pragma interface                       /* gcc class implementation */
 
3
#endif
19
4
 
20
5
 
21
6
#ifndef DRIZZLED_FIELD_ITERATOR_H
22
7
#define DRIZZLED_FIELD_ITERATOR_H
23
8
 
24
 
#include "drizzled/memory/sql_alloc.h"
25
 
#include <drizzled/sql_list.h>
26
 
#include <drizzled/natural_join_column.h>
27
 
 
28
 
namespace drizzled
29
 
{
30
 
 
31
9
class Table;
32
10
class TableList;
33
11
 
35
13
  Iterator over the fields of a generic table reference.
36
14
*/
37
15
 
38
 
class Field_iterator: public memory::SqlAlloc
 
16
class Field_iterator: public Sql_alloc
39
17
{
40
18
public:
41
19
  Field_iterator() {}                         /* Remove gcc warning */
44
22
  virtual void next()= 0;
45
23
  virtual bool end_of_fields()= 0;              /* Return 1 at end of list */
46
24
  virtual const char *name()= 0;
47
 
  virtual Item *create_item(Session *)= 0;
 
25
  virtual Item *create_item(THD *)= 0;
48
26
  virtual Field *field()= 0;
49
27
};
50
28
 
51
29
 
52
 
/*
 
30
/* 
53
31
  Iterator over the fields of a base table, view with temporary
54
32
  table, or subquery.
55
33
*/
64
42
  void next() { ptr++; }
65
43
  bool end_of_fields() { return *ptr == 0; }
66
44
  const char *name();
67
 
  Item *create_item(Session *session);
 
45
  Item *create_item(THD *thd);
68
46
  Field *field() { return *ptr; }
69
47
};
70
48
 
87
65
  void next();
88
66
  bool end_of_fields() { return !cur_column_ref; }
89
67
  const char *name() { return cur_column_ref->name(); }
90
 
  Item *create_item(Session *session) { return cur_column_ref->create_item(session); }
 
68
  Item *create_item(THD *thd) { return cur_column_ref->create_item(thd); }
91
69
  Field *field() { return cur_column_ref->field(); }
92
70
  Natural_join_column *column_ref() { return cur_column_ref; }
93
71
};
125
103
  const char *name() { return field_it->name(); }
126
104
  const char *table_name();
127
105
  const char *db_name();
128
 
  Item *create_item(Session *session) { return field_it->create_item(session); }
 
106
  Item *create_item(THD *thd) { return field_it->create_item(thd); }
129
107
  Field *field() { return field_it->field(); }
130
108
  Natural_join_column *get_or_create_column_ref(TableList *parent_table_ref);
131
109
  Natural_join_column *get_natural_column_ref();
132
110
};
133
111
 
134
 
} /* namespace drizzled */
135
112
 
136
113
#endif /* DRIZZLED_FIELD_ITERATOR_H */