~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/generator/table.h

  • Committer: Andrew Hutchings
  • Date: 2011-02-01 10:23:22 UTC
  • mto: (2136.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2137.
  • Revision ID: andrew@linuxjedi.co.uk-20110201102322-oxztcyrjzg3c7yta
Fix counters cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#pragma once
 
21
#ifndef DRIZZLED_GENERATOR_TABLE_H
 
22
#define DRIZZLED_GENERATOR_TABLE_H
22
23
 
23
 
#include <drizzled/plugin/storage_engine.h>
 
24
#include "drizzled/session.h"
 
25
#include "drizzled/plugin/storage_engine.h"
24
26
 
25
27
namespace drizzled {
26
28
namespace generator {
28
30
class Table
29
31
{
30
32
  Session &session;
 
33
  message::table::shared_ptr table;
31
34
 
32
 
  identifier::table::vector table_names;
33
 
  identifier::table::vector::const_iterator table_iterator;
 
35
  identifier::Table::vector table_names;
 
36
  identifier::Table::vector::const_iterator table_iterator;
34
37
 
35
38
public:
36
39
 
40
43
  {
41
44
    while (table_iterator != table_names.end())
42
45
    {
43
 
      message::table::shared_ptr table;
44
 
      table= plugin::StorageEngine::getTableMessage(session, *table_iterator);
 
46
      table->Clear();
 
47
      bool is_table_parsed= plugin::StorageEngine::getTableDefinition(session, *table_iterator, table);
45
48
      table_iterator++;
46
49
 
47
 
      if (table)
 
50
      if (is_table_parsed)
48
51
        return table;
49
52
    }
50
53
 
68
71
} /* namespace generator */
69
72
} /* namespace drizzled */
70
73
 
 
74
#endif /* DRIZZLED_GENERATOR_TABLE_H */