~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/generator/table.h

  • Committer: Brian Aker
  • Date: 2011-02-17 10:09:00 UTC
  • mfrom: (2173.2.1 clean-include-usuage)
  • Revision ID: brian@tangent.org-20110217100900-4tpuxxzdl1sj00sh
Merge Monty for headers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef DRIZZLED_GENERATOR_TABLE_H
22
22
#define DRIZZLED_GENERATOR_TABLE_H
23
23
 
24
 
#include "drizzled/session.h"
25
 
#include "drizzled/plugin/storage_engine.h"
 
24
#include <drizzled/plugin/storage_engine.h>
26
25
 
27
26
namespace drizzled {
 
27
 
 
28
class Session;
 
29
 
28
30
namespace generator {
29
31
 
30
32
class Table
31
33
{
32
34
  Session &session;
33
 
  message::table::shared_ptr table;
34
35
 
35
 
  TableIdentifier::vector table_names;
36
 
  TableIdentifier::vector::const_iterator table_iterator;
 
36
  identifier::Table::vector table_names;
 
37
  identifier::Table::vector::const_iterator table_iterator;
37
38
 
38
39
public:
39
40
 
40
 
  Table(Session &arg, const SchemaIdentifier &schema_identifier);
 
41
  Table(Session &arg, const identifier::Schema &schema_identifier);
41
42
 
42
43
  operator const drizzled::message::table::shared_ptr()
43
44
  {
44
45
    while (table_iterator != table_names.end())
45
46
    {
46
 
      table->Clear();
47
 
      bool is_table_parsed= plugin::StorageEngine::getTableDefinition(session, *table_iterator, table);
 
47
      message::table::shared_ptr table;
 
48
      table= plugin::StorageEngine::getTableMessage(session, *table_iterator);
48
49
      table_iterator++;
49
50
 
50
 
      if (is_table_parsed)
 
51
      if (table)
51
52
        return table;
52
53
    }
53
54
 
54
55
    return message::table::shared_ptr();
55
56
  }
56
57
 
57
 
  operator const drizzled::TableIdentifier*()
 
58
  operator const drizzled::identifier::Table*()
58
59
  {
59
60
    while (table_iterator != table_names.end())
60
61
    {
61
 
      const drizzled::TableIdentifier *_ptr= &(*table_iterator);
 
62
      const drizzled::identifier::Table *_ptr= &(*table_iterator);
62
63
      table_iterator++;
63
64
 
64
65
      return _ptr;