~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/function_engine/function.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

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
                    const char *,
 
48
                    drizzled::Table&,
 
49
                    drizzled::message::Table&)
 
50
  {
 
51
    return EPERM;
 
52
  }
 
53
 
 
54
  int doDropTable(drizzled::Session&, const std::string&) 
 
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(const drizzled::TableIdentifier &identifier);
 
73
 
 
74
 
 
75
  void doGetTableNames(drizzled::CachedDirectory&, 
 
76
                       std::string &db, 
 
77
                       std::set<std::string> &set_of_names);
 
78
 
 
79
  int doGetTableDefinition(drizzled::Session &session,
 
80
                           const char *path,
 
81
                           const char *db,
 
82
                           const char *table_name,
 
83
                           const bool is_tmp,
 
84
                           drizzled::message::Table *table_proto);
 
85
 
 
86
  void doGetSchemaNames(std::set<std::string>& set_of_names);
 
87
 
 
88
  bool doGetSchemaDefinition(const std::string &schema_name, drizzled::message::Schema &schema_message);
 
89
};
 
90
 
 
91
#endif /* PLUGIN_FUNCTION_ENGINE_FUNCTION_H */