~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/table_function.h

Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21
21
 */
22
22
 
23
 
#ifndef DRIZZLED_PLUGIN_TABLE_FUNCTION_H
24
 
#define DRIZZLED_PLUGIN_TABLE_FUNCTION_H
 
23
#pragma once
25
24
 
26
25
#include <drizzled/definitions.h>
27
26
#include <drizzled/plugin.h>
37
36
 
38
37
#include <drizzled/visibility.h>
39
38
 
40
 
namespace drizzled
41
 
{
 
39
namespace drizzled {
 
40
 
 
41
namespace statement { class Statement; }
 
42
 
 
43
class LEX;
42
44
 
43
45
namespace plugin
44
46
{
88
90
  virtual ~TableFunction() {}
89
91
 
90
92
  static bool addPlugin(TableFunction *function);
91
 
  static void removePlugin(TableFunction *) 
 
93
  static void removePlugin(TableFunction *)
92
94
  { }
93
95
  static TableFunction *getFunction(const std::string &arg);
94
96
  static void getNames(const std::string &arg,
102
104
    SIZE
103
105
  };
104
106
 
105
 
  class Generator 
 
107
  class Generator
106
108
  {
107
109
    Field **columns;
108
110
    Field **columns_iterator;
109
111
    Session *session;
110
112
 
111
113
  protected:
 
114
        LEX& lex();
 
115
        statement::Statement& statement();
112
116
 
113
117
    drizzled::Session &getSession()
114
118
    {
143
147
  };
144
148
 
145
149
  void define(message::Table &arg)
146
 
  { 
 
150
  {
147
151
    arg.CopyFrom(proto);
148
152
  }
149
153
 
150
154
  const std::string &getTableLabel()
151
 
  { 
 
155
  {
152
156
    return original_table_label;
153
157
  }
154
158
 
155
159
  const std::string &getIdentifierTableName()
156
 
  { 
 
160
  {
157
161
    return identifier.getTableName();
158
162
  }
159
163
 
160
164
  const std::string &getSchemaHome()
161
 
  { 
 
165
  {
162
166
    return identifier.getSchemaName();
163
167
  }
164
168
 
165
169
  const std::string &getPath()
166
 
  { 
 
170
  {
167
171
    return identifier.getPath();
168
172
  }
169
173
 
185
189
                 uint32_t field_length,
186
190
                 bool is_default_null= false);
187
191
 
188
 
  virtual bool visable() { return true; }
 
192
  virtual bool visible() const { return true; }
189
193
};
190
194
 
191
195
} /* namespace plugin */
192
196
} /* namespace drizzled */
193
197
 
194
 
#endif /* DRIZZLED_PLUGIN_TABLE_FUNCTION_H */