~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_dictionary/tables.h

  • Committer: Brian Aker
  • Date: 2010-12-18 18:24:57 UTC
  • mfrom: (1999.6.3 trunk)
  • Revision ID: brian@tangent.org-20101218182457-yi1wd0so2hml1k1w
Merge in Lee's copyright header fix

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) 2010 Sun Microsystems, Inc.
 
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_SCHEMA_DICTIONARY_TABLES_H
 
22
#define PLUGIN_SCHEMA_DICTIONARY_TABLES_H
 
23
 
 
24
class TablesTool : public drizzled::plugin::TableFunction
 
25
{
 
26
public:
 
27
 
 
28
  TablesTool();
 
29
 
 
30
  TablesTool(const char *schema_arg, const char *table_arg) :
 
31
    drizzled::plugin::TableFunction(schema_arg, table_arg)
 
32
  { }
 
33
 
 
34
  TablesTool(const char *table_arg) :
 
35
    drizzled::plugin::TableFunction("DATA_DICTIONARY", table_arg)
 
36
  { }
 
37
 
 
38
  class Generator : public drizzled::plugin::TableFunction::Generator 
 
39
  {
 
40
    drizzled::generator::AllTables all_tables_generator;
 
41
    drizzled::message::Table table_message;
 
42
 
 
43
    virtual void fill();
 
44
 
 
45
  public:
 
46
    Generator(drizzled::Field **arg);
 
47
 
 
48
    bool nextTable();
 
49
 
 
50
    const std::string &table_name()
 
51
    {
 
52
      return table_message.name();
 
53
    }
 
54
 
 
55
    const drizzled::message::Table& getTableProto()
 
56
    {
 
57
      return table_message;
 
58
    }
 
59
 
 
60
    const drizzled::message::Table& getTableMessage()
 
61
    {
 
62
      return table_message;
 
63
    }
 
64
 
 
65
    bool isTablesPrimed()
 
66
    {
 
67
      return true;
 
68
    }
 
69
 
 
70
    bool populate();
 
71
  };
 
72
 
 
73
  Generator *generator(drizzled::Field **arg)
 
74
  {
 
75
    return new Generator(arg);
 
76
  }
 
77
 
 
78
};
 
79
 
 
80
#endif /* PLUGIN_SCHEMA_DICTIONARY_TABLES_H */