~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/data_engine/tables.h

Update code, first pass through cleaner method for recursing through
dictionary of table information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef PLUGIN_DATA_ENGINE_TABLES_H
22
22
#define PLUGIN_DATA_ENGINE_TABLES_H
23
23
 
24
 
class TablesTool : public Tool
 
24
class TablesTool : public SchemasTool
25
25
{
26
26
public:
27
27
 
28
28
  TablesTool();
 
29
 
29
30
  TablesTool(const char *arg) :
30
 
    Tool(arg)
 
31
    SchemasTool(arg)
31
32
  { }
32
33
 
33
 
  class Generator : public Tool::Generator 
 
34
  class Generator : public SchemasTool::Generator 
34
35
  {
35
 
    std::set<std::string> schema_names;
 
36
    drizzled::message::Table table_proto;
36
37
    std::set<std::string> table_names;
37
 
    std::set<std::string>::iterator schema_iterator;
38
38
    std::set<std::string>::iterator table_iterator;
39
 
    uint32_t schema_counter;
 
39
    bool is_tables_primed;
 
40
 
 
41
    void fill();
 
42
    bool nextTableCore();
40
43
 
41
44
  public:
42
 
    Generator();
43
 
 
44
 
    const std::string &schema_name()
45
 
    {
46
 
      return (*schema_iterator);
47
 
    }
 
45
    Generator(Field **arg);
48
46
 
49
47
    const std::string &table_name()
50
48
    {
51
49
      return (*table_iterator);
52
50
    }
53
51
 
 
52
    const drizzled::message::Table& getTableProto()
 
53
    {
 
54
      return table_proto;
 
55
    }
 
56
 
 
57
    bool isTablesPrimed()
 
58
    {
 
59
      return is_tables_primed;
 
60
    }
 
61
 
54
62
    bool populate(Field ** fields);
55
 
    virtual bool fill(Field ** fields);
56
 
  };
57
 
 
58
 
  Generator *generator()
59
 
  {
60
 
    return new Generator;
61
 
  }
62
 
 
63
 
};
64
 
 
65
 
class TablesNameTool : public TablesTool
66
 
{
67
 
public:
68
 
 
69
 
  TablesNameTool();
70
 
 
71
 
  class Generator : public TablesTool::Generator 
72
 
  {
73
 
 
74
 
  public:
75
 
    Generator() :
76
 
      TablesTool::Generator()
77
 
    { }
78
 
 
79
 
    bool fill(Field ** fields);
80
 
  };
81
 
 
82
 
  Generator *generator()
83
 
  {
84
 
    return new Generator;
85
 
  }
86
 
};
87
 
 
88
 
class TablesInfoTool : public TablesTool
89
 
{
90
 
public:
91
 
 
92
 
  TablesInfoTool();
93
 
 
94
 
  class Generator : public TablesTool::Generator 
95
 
  {
96
 
  public:
97
 
    Generator() :
98
 
      TablesTool::Generator()
99
 
    { }
100
 
 
101
 
    bool fill(Field ** fields);
102
 
  };
103
 
 
104
 
  Generator *generator()
105
 
  {
106
 
    return new Generator;
107
 
  }
 
63
    bool nextTable();
 
64
  };
 
65
 
 
66
  Generator *generator(Field **arg)
 
67
  {
 
68
    return new Generator(arg);
 
69
  }
 
70
 
108
71
};
109
72
 
110
73
#endif // PLUGIN_DATA_ENGINE_TABLES_H