~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/generator/table.h

  • Committer: Monty Taylor
  • Date: 2010-10-21 23:10:12 UTC
  • mto: (1879.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1880.
  • Revision ID: mordred@inaugust.com-20101021231012-uhsebiqo23xi0ygy
Updated AUTHORS list with everyone from bzr logs.

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