~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_dictionary/tables.h

  • Committer: Brian Aker
  • Date: 2010-06-05 00:15:57 UTC
  • mfrom: (1589.1.1 drizzle_events)
  • Revision ID: brian@gaz-20100605001557-j1k41ni5k9mis891
Merge in Barry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2010 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2010 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
21
21
#ifndef PLUGIN_SCHEMA_DICTIONARY_TABLES_H
22
22
#define PLUGIN_SCHEMA_DICTIONARY_TABLES_H
23
23
 
24
 
class TablesTool : public drizzled::plugin::TableFunction
 
24
class TablesTool : public SchemasTool
25
25
{
26
26
public:
27
27
 
28
28
  TablesTool();
29
29
 
30
30
  TablesTool(const char *schema_arg, const char *table_arg) :
31
 
    drizzled::plugin::TableFunction(schema_arg, table_arg)
 
31
    SchemasTool(schema_arg, table_arg)
32
32
  { }
33
33
 
34
34
  TablesTool(const char *table_arg) :
35
 
    drizzled::plugin::TableFunction("DATA_DICTIONARY", table_arg)
 
35
    SchemasTool(table_arg)
36
36
  { }
37
37
 
38
 
  class Generator : public drizzled::plugin::TableFunction::Generator 
 
38
  class Generator : public SchemasTool::Generator 
39
39
  {
40
 
    drizzled::generator::AllTables all_tables_generator;
41
 
    drizzled::message::Table table_message;
 
40
    drizzled::message::Table table_proto;
 
41
    std::set<std::string> table_names;
 
42
    std::set<std::string>::iterator table_iterator;
 
43
    bool is_tables_primed;
42
44
 
43
45
    virtual void fill();
 
46
    bool nextTableCore();
44
47
 
45
48
  public:
46
49
    Generator(drizzled::Field **arg);
47
50
 
48
 
    bool nextTable();
 
51
    void pushRow(drizzled::message::Table::TableOptions::RowType type);
 
52
    void pushType(drizzled::message::Table::Field::FieldType type);
49
53
 
50
54
    const std::string &table_name()
51
55
    {
52
 
      return table_message.name();
 
56
      return (*table_iterator);
53
57
    }
54
58
 
55
59
    const drizzled::message::Table& getTableProto()
56
60
    {
57
 
      return table_message;
58
 
    }
59
 
 
60
 
    const drizzled::message::Table& getTableMessage()
61
 
    {
62
 
      return table_message;
 
61
      return table_proto;
63
62
    }
64
63
 
65
64
    bool isTablesPrimed()
66
65
    {
67
 
      return true;
 
66
      return is_tables_primed;
68
67
    }
69
68
 
70
69
    bool populate();
 
70
    bool nextTable();
71
71
  };
72
72
 
73
73
  Generator *generator(drizzled::Field **arg)