~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/table_function.h

  • Committer: Lee Bieber
  • Date: 2011-03-13 16:37:38 UTC
  • mfrom: (2227.4.18 session2)
  • Revision ID: kalebral@gmail.com-20110313163738-7ti21zk40o2xi3ew
Merge Olaf - Refactor Session

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *
4
4
 *  Definitions required for TableFunction plugin
5
5
 *
6
 
 *  Copyright (C) 2010 Sun Microsystems
 
6
 *  Copyright (C) 2010 Sun Microsystems, Inc.
7
7
 *  Copyright (C) 2010 Monty Taylor
8
8
 *
9
9
 *  This program is free software; you can redistribute it and/or modify
24
24
#define DRIZZLED_PLUGIN_TABLE_FUNCTION_H
25
25
 
26
26
#include <drizzled/definitions.h>
27
 
#include "drizzled/plugin.h"
28
 
#include "drizzled/plugin/plugin.h"
29
 
#include "drizzled/identifier.h"
30
 
#include "drizzled/message/table.pb.h"
31
 
#include "drizzled/charset.h"
32
 
#include "drizzled/field.h"
 
27
#include <drizzled/plugin.h>
 
28
#include <drizzled/plugin/plugin.h>
 
29
#include <drizzled/identifier.h>
 
30
#include <drizzled/message/table.pb.h>
 
31
#include <drizzled/charset.h>
 
32
#include <drizzled/field.h>
33
33
 
34
34
#include <string>
35
35
#include <set>
36
36
#include <algorithm>
37
37
 
38
 
namespace drizzled
39
 
{
40
 
 
41
 
extern int wild_case_compare(const CHARSET_INFO * const cs, 
42
 
                             const char *str,const char *wildstr);
 
38
#include <drizzled/visibility.h>
 
39
 
 
40
namespace drizzled {
 
41
 
 
42
namespace statement { class Statement; }
 
43
 
 
44
class LEX;
43
45
 
44
46
namespace plugin
45
47
{
61
63
  return buffer;
62
64
}
63
65
 
64
 
class TableFunction : public Plugin
 
66
class DRIZZLED_API TableFunction : public Plugin
65
67
{
66
68
  TableFunction();
67
69
  TableFunction(const TableFunction &);
68
70
  TableFunction& operator=(const TableFunction &);
69
71
 
70
72
  message::Table proto;
71
 
  TableIdentifier identifier;
 
73
  identifier::Table identifier;
72
74
  std::string local_path;
73
75
  std::string original_table_label;
74
76
 
89
91
  virtual ~TableFunction() {}
90
92
 
91
93
  static bool addPlugin(TableFunction *function);
92
 
  static void removePlugin(TableFunction *) 
 
94
  static void removePlugin(TableFunction *)
93
95
  { }
94
96
  static TableFunction *getFunction(const std::string &arg);
95
97
  static void getNames(const std::string &arg,
99
101
    BOOLEAN,
100
102
    NUMBER,
101
103
    STRING,
102
 
    VARBINARY
 
104
    VARBINARY,
 
105
    SIZE
103
106
  };
104
107
 
105
 
  class Generator 
 
108
  class Generator
106
109
  {
107
110
    Field **columns;
108
111
    Field **columns_iterator;
109
112
    Session *session;
110
113
 
111
114
  protected:
 
115
        LEX& lex();
 
116
        statement::Statement& statement();
112
117
 
113
118
    drizzled::Session &getSession()
114
119
    {
143
148
  };
144
149
 
145
150
  void define(message::Table &arg)
146
 
  { 
 
151
  {
147
152
    arg.CopyFrom(proto);
148
153
  }
149
154
 
150
155
  const std::string &getTableLabel()
151
 
  { 
 
156
  {
152
157
    return original_table_label;
153
158
  }
154
159
 
155
160
  const std::string &getIdentifierTableName()
156
 
  { 
 
161
  {
157
162
    return identifier.getTableName();
158
163
  }
159
164
 
160
165
  const std::string &getSchemaHome()
161
 
  { 
 
166
  {
162
167
    return identifier.getSchemaName();
163
168
  }
164
169
 
165
170
  const std::string &getPath()
166
 
  { 
 
171
  {
167
172
    return identifier.getPath();
168
173
  }
169
174
 
185
190
                 uint32_t field_length,
186
191
                 bool is_default_null= false);
187
192
 
188
 
  virtual bool visable() { return true; }
 
193
  virtual bool visible() const { return true; }
189
194
};
190
195
 
191
196
} /* namespace plugin */