~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/function_engine/function.h

  • Committer: Brian Aker
  • Date: 2009-07-16 22:37:01 UTC
  • mto: This revision was merged to the branch mainline in revision 1100.
  • Revision ID: brian@gaz-20090716223701-vbbbo8dmgd2ljqqo
Refactor TableShare has to be behind class.

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) 2009 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; either version 2 of the License, or
9
 
 *  (at your option) any later version.
10
 
 *
11
 
 *  This program is distributed in the hope that it will be useful,
12
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 *  GNU General Public License for more details.
15
 
 *
16
 
 *  You should have received a copy of the GNU General Public License
17
 
 *  along with this program; if not, write to the Free Software
18
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 
 */
20
 
 
21
 
#ifndef PLUGIN_FUNCTION_ENGINE_FUNCTION_H
22
 
#define PLUGIN_FUNCTION_ENGINE_FUNCTION_H
23
 
 
24
 
#include <assert.h>
25
 
#include <drizzled/session.h>
26
 
#include <drizzled/plugin/storage_engine.h>
27
 
#include <drizzled/plugin/table_function.h>
28
 
 
29
 
extern const drizzled::CHARSET_INFO *default_charset_info;
30
 
 
31
 
static const char *function_exts[] = {
32
 
  NULL
33
 
};
34
 
 
35
 
class Function : public drizzled::plugin::StorageEngine
36
 
{
37
 
 
38
 
public:
39
 
  Function(const std::string &name_arg);
40
 
 
41
 
  ~Function()
42
 
  { }
43
 
 
44
 
  drizzled::plugin::TableFunction *getTool(const char *name_arg);
45
 
 
46
 
  int doCreateTable(drizzled::Session&,
47
 
                    drizzled::Table&,
48
 
                    drizzled::TableIdentifier &,
49
 
                    drizzled::message::Table&)
50
 
  {
51
 
    return EPERM;
52
 
  }
53
 
 
54
 
  int doDropTable(drizzled::Session&, drizzled::TableIdentifier&)
55
 
  { 
56
 
    return EPERM; 
57
 
  }
58
 
 
59
 
  virtual drizzled::Cursor *create(drizzled::TableShare &table,
60
 
                                   drizzled::memory::Root *mem_root);
61
 
 
62
 
  const char **bas_ext() const 
63
 
  {
64
 
    return function_exts;
65
 
  }
66
 
 
67
 
  drizzled::plugin::TableFunction *getFunction(const std::string &path)
68
 
  {
69
 
    return drizzled::plugin::TableFunction::getFunction(path);
70
 
  }
71
 
 
72
 
  bool doCanCreateTable(drizzled::TableIdentifier &identifier);
73
 
 
74
 
 
75
 
  void doGetTableNames(drizzled::CachedDirectory&, 
76
 
                       drizzled::SchemaIdentifier &schema_identifier,
77
 
                       std::set<std::string> &set_of_names);
78
 
 
79
 
  int doGetTableDefinition(drizzled::Session &session,
80
 
                           drizzled::TableIdentifier &identifier,
81
 
                           drizzled::message::Table &table_message);
82
 
 
83
 
  void doGetSchemaIdentifiers(drizzled::SchemaIdentifierList&);
84
 
 
85
 
  bool doDoesTableExist(drizzled::Session& session, drizzled::TableIdentifier &identifier);
86
 
 
87
 
  bool doGetSchemaDefinition(drizzled::SchemaIdentifier &schema, drizzled::message::Schema &schema_message);
88
 
 
89
 
  int doRenameTable(drizzled::Session&, drizzled::TableIdentifier &, drizzled::TableIdentifier &)
90
 
  {
91
 
    return EPERM;
92
 
  }
93
 
 
94
 
  void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
95
 
                             drizzled::SchemaIdentifier &schema_identifier,
96
 
                             drizzled::TableIdentifiers &set_of_identifiers);
97
 
};
98
 
 
99
 
#endif /* PLUGIN_FUNCTION_ENGINE_FUNCTION_H */