~drizzle-trunk/drizzle/development

1273.13.5 by Brian Aker
Additional definitions.
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
4
 *  Copyright (C) 2010 Sun Microsystems, Inc.
1273.13.5 by Brian Aker
Additional definitions.
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
1273.13.50 by Brian Aker
Additional plugins.
21
#ifndef PLUGIN_SCHEMA_DICTIONARY_TABLES_H
22
#define PLUGIN_SCHEMA_DICTIONARY_TABLES_H
1273.13.5 by Brian Aker
Additional definitions.
23
1643.3.1 by Brian Aker
Move schema listing logic out.
24
class TablesTool : public drizzled::plugin::TableFunction
1273.13.5 by Brian Aker
Additional definitions.
25
{
26
public:
1273.13.8 by Brian Aker
Second pass through the interface.
27
1273.13.5 by Brian Aker
Additional definitions.
28
  TablesTool();
1273.13.18 by Brian Aker
Update code, first pass through cleaner method for recursing through
29
1273.13.25 by Brian Aker
Updates for table functions to insert tables into additional schemas;
30
  TablesTool(const char *schema_arg, const char *table_arg) :
1643.3.1 by Brian Aker
Move schema listing logic out.
31
    drizzled::plugin::TableFunction(schema_arg, table_arg)
1273.13.25 by Brian Aker
Updates for table functions to insert tables into additional schemas;
32
  { }
33
34
  TablesTool(const char *table_arg) :
1643.3.1 by Brian Aker
Move schema listing logic out.
35
    drizzled::plugin::TableFunction("DATA_DICTIONARY", table_arg)
1273.13.12 by Brian Aker
Refactored to make the code a tiny bit simpler to follow.
36
  { }
37
1643.3.1 by Brian Aker
Move schema listing logic out.
38
  class Generator : public drizzled::plugin::TableFunction::Generator 
1273.13.12 by Brian Aker
Refactored to make the code a tiny bit simpler to follow.
39
  {
1643.3.5 by Brian Aker
Addd an "all_tables" generator to loop through all tables.
40
    drizzled::generator::AllTables all_tables_generator;
41
    drizzled::message::Table table_message;
1273.13.18 by Brian Aker
Update code, first pass through cleaner method for recursing through
42
1273.13.36 by Brian Aker
Adding support for LOCAL_TABLE_NAMES and SCHEMA_NAMES
43
    virtual void fill();
1273.13.12 by Brian Aker
Refactored to make the code a tiny bit simpler to follow.
44
45
  public:
1273.14.5 by Monty Taylor
Merged trunk.
46
    Generator(drizzled::Field **arg);
1273.13.12 by Brian Aker
Refactored to make the code a tiny bit simpler to follow.
47
1643.3.5 by Brian Aker
Addd an "all_tables" generator to loop through all tables.
48
    bool nextTable();
49
1273.13.14 by Brian Aker
Patching up naming.
50
    const std::string &table_name()
1273.13.12 by Brian Aker
Refactored to make the code a tiny bit simpler to follow.
51
    {
1643.3.5 by Brian Aker
Addd an "all_tables" generator to loop through all tables.
52
      return table_message.name();
1273.13.12 by Brian Aker
Refactored to make the code a tiny bit simpler to follow.
53
    }
54
1273.13.18 by Brian Aker
Update code, first pass through cleaner method for recursing through
55
    const drizzled::message::Table& getTableProto()
56
    {
1643.3.5 by Brian Aker
Addd an "all_tables" generator to loop through all tables.
57
      return table_message;
58
    }
59
60
    const drizzled::message::Table& getTableMessage()
61
    {
62
      return table_message;
1273.13.18 by Brian Aker
Update code, first pass through cleaner method for recursing through
63
    }
64
65
    bool isTablesPrimed()
66
    {
1643.3.2 by Brian Aker
Table now uses the generator.
67
      return true;
1273.13.18 by Brian Aker
Update code, first pass through cleaner method for recursing through
68
    }
69
1273.13.21 by Brian Aker
Fix interface (we no longer need Fields passed around).
70
    bool populate();
1273.13.18 by Brian Aker
Update code, first pass through cleaner method for recursing through
71
  };
72
1273.14.5 by Monty Taylor
Merged trunk.
73
  Generator *generator(drizzled::Field **arg)
1273.13.18 by Brian Aker
Update code, first pass through cleaner method for recursing through
74
  {
75
    return new Generator(arg);
76
  }
77
1273.13.11 by Brian Aker
First pass through tables.
78
};
79
1273.13.65 by Brian Aker
Lint fixes.
80
#endif /* PLUGIN_SCHEMA_DICTIONARY_TABLES_H */