~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/data_engine/dictionary.h

First pass through data dictionary.

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
#include "config.h"
 
22
#include <assert.h>
 
23
#include <drizzled/session.h>
 
24
#include <drizzled/plugin/storage_engine.h>
 
25
 
 
26
#ifndef PLUGIN_DATA_ENGINE_DICTIONARY_H
 
27
#define PLUGIN_DATA_ENGINE_DICTIONARY_H
 
28
 
 
29
#include <plugin/data_engine/tool.h>
 
30
#include <plugin/data_engine/processlist.h>
 
31
#include <plugin/data_engine/modules.h>
 
32
#include <plugin/data_engine/plugins.h>
 
33
 
 
34
extern const CHARSET_INFO *default_charset_info;
 
35
 
 
36
static const std::string engine_name("DICTIONARY");
 
37
 
 
38
static const char *dictionary_exts[] = {
 
39
  NULL
 
40
};
 
41
 
 
42
class Dictionary : public drizzled::plugin::StorageEngine
 
43
{
 
44
  ProcesslistTool processlist;
 
45
  ModulesTool modules;
 
46
  PluginsTool plugins;
 
47
 
 
48
public:
 
49
  Dictionary(const std::string &name_arg);
 
50
 
 
51
  ~Dictionary()
 
52
  {
 
53
  }
 
54
 
 
55
  Tool *getTool(const char *name_arg);
 
56
 
 
57
  int doCreateTable(Session *,
 
58
                    const char *,
 
59
                    Table&,
 
60
                    drizzled::message::Table&)
 
61
  {
 
62
    return EPERM;
 
63
  }
 
64
 
 
65
  int doDropTable(Session&, const std::string) 
 
66
  { 
 
67
    return EPERM; 
 
68
  }
 
69
 
 
70
  virtual Cursor *create(TableShare &table, drizzled::memory::Root *mem_root);
 
71
 
 
72
  const char **bas_ext() const 
 
73
  {
 
74
    return dictionary_exts;
 
75
  }
 
76
 
 
77
  void doGetTableNames(drizzled::CachedDirectory&, 
 
78
                       std::string &db, 
 
79
                       std::set<std::string> &set_of_names);
 
80
 
 
81
  int doGetTableDefinition(Session &session,
 
82
                           const char *path,
 
83
                           const char *db,
 
84
                           const char *table_name,
 
85
                           const bool is_tmp,
 
86
                           drizzled::message::Table *table_proto);
 
87
};
 
88
 
 
89
#endif /* PLUGIN_DATA_ENGINE_DICTIONARY_H */