~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/table_function.h

Merge Monty - Added inter-plugin dependencies for controlling plugin load order

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
 
#pragma once
 
23
#ifndef DRIZZLED_PLUGIN_TABLE_FUNCTION_H
 
24
#define DRIZZLED_PLUGIN_TABLE_FUNCTION_H
24
25
 
25
26
#include <drizzled/definitions.h>
26
 
#include <drizzled/plugin.h>
27
 
#include <drizzled/plugin/plugin.h>
28
 
#include <drizzled/identifier.h>
29
 
#include <drizzled/message/table.pb.h>
30
 
#include <drizzled/charset.h>
31
 
#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"
32
33
 
33
34
#include <string>
34
35
#include <set>
35
36
#include <algorithm>
36
37
 
37
 
#include <drizzled/visibility.h>
38
 
 
39
 
namespace drizzled {
40
 
namespace plugin {
 
38
namespace drizzled
 
39
{
 
40
 
 
41
extern int wild_case_compare(const CHARSET_INFO * const cs, 
 
42
                             const char *str,const char *wildstr);
 
43
 
 
44
namespace plugin
 
45
{
41
46
 
42
47
#define TABLE_FUNCTION_BLOB_SIZE 2049
43
48
 
56
61
  return buffer;
57
62
}
58
63
 
59
 
class DRIZZLED_API TableFunction : public Plugin
 
64
class TableFunction : public Plugin
60
65
{
61
66
  TableFunction();
62
67
  TableFunction(const TableFunction &);
84
89
  virtual ~TableFunction() {}
85
90
 
86
91
  static bool addPlugin(TableFunction *function);
87
 
  static void removePlugin(TableFunction *)
 
92
  static void removePlugin(TableFunction *) 
88
93
  { }
89
94
  static TableFunction *getFunction(const std::string &arg);
90
95
  static void getNames(const std::string &arg,
98
103
    SIZE
99
104
  };
100
105
 
101
 
  class Generator
 
106
  class Generator 
102
107
  {
103
108
    Field **columns;
104
109
    Field **columns_iterator;
105
110
    Session *session;
106
111
 
107
112
  protected:
108
 
        LEX& lex();
109
 
        statement::Statement& statement();
110
113
 
111
114
    drizzled::Session &getSession()
112
115
    {
114
117
    }
115
118
 
116
119
  public:
117
 
    const charset_info_st *scs;
 
120
    const CHARSET_INFO *scs;
118
121
 
119
122
    Generator(Field **arg);
120
123
    virtual ~Generator()
141
144
  };
142
145
 
143
146
  void define(message::Table &arg)
144
 
  {
 
147
  { 
145
148
    arg.CopyFrom(proto);
146
149
  }
147
150
 
148
151
  const std::string &getTableLabel()
149
 
  {
 
152
  { 
150
153
    return original_table_label;
151
154
  }
152
155
 
153
156
  const std::string &getIdentifierTableName()
154
 
  {
 
157
  { 
155
158
    return identifier.getTableName();
156
159
  }
157
160
 
158
161
  const std::string &getSchemaHome()
159
 
  {
 
162
  { 
160
163
    return identifier.getSchemaName();
161
164
  }
162
165
 
163
166
  const std::string &getPath()
164
 
  {
 
167
  { 
165
168
    return identifier.getPath();
166
169
  }
167
170
 
183
186
                 uint32_t field_length,
184
187
                 bool is_default_null= false);
185
188
 
186
 
  virtual bool visible() const { return true; }
 
189
  virtual bool visable() { return true; }
187
190
};
188
191
 
189
192
} /* namespace plugin */
190
193
} /* namespace drizzled */
191
194
 
 
195
#endif /* DRIZZLED_PLUGIN_TABLE_FUNCTION_H */