~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/generator/all_tables.h

  • Committer: Olaf van der Spek
  • Date: 2011-03-28 14:32:36 UTC
  • mto: (2257.1.1 build) (2276.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2258.
  • Revision ID: olafvdspek@gmail.com-20110328143236-4ge1d793iqaktfq0
Common fwd

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
 
#ifndef DRIZZLED_GENERATOR_ALL_TABLES_H
22
 
#define DRIZZLED_GENERATOR_ALL_TABLES_H
 
21
#pragma once
23
22
 
24
 
#include "drizzled/plugin/storage_engine.h"
 
23
#include <drizzled/plugin/storage_engine.h>
25
24
 
26
25
namespace drizzled {
27
26
namespace generator {
29
28
class AllTables
30
29
{
31
30
  Session &session;
32
 
  message::table::shared_ptr table;
33
31
 
34
 
  TableIdentifier::vector table_names;
35
 
  TableIdentifier::vector::const_iterator table_iterator;
 
32
  identifier::Table::vector table_names;
 
33
  identifier::Table::vector::const_iterator table_iterator;
36
34
 
37
35
  drizzled::generator::Schema schema_generator;
38
 
  const drizzled::SchemaIdentifier *schema_ptr;
 
36
  const drizzled::identifier::Schema *schema_ptr;
39
37
 
40
38
  bool table_setup();
41
39
 
50
48
    do {
51
49
      while (table_iterator != table_names.end())
52
50
      {
53
 
        bool is_table_parsed= plugin::StorageEngine::getTableDefinition(session, *table_iterator, table);
 
51
        message::table::shared_ptr table;
 
52
        table= plugin::StorageEngine::getTableMessage(session, *table_iterator);
54
53
        table_iterator++;
55
54
 
56
 
        if (is_table_parsed)
 
55
        if (table)
57
56
          return table;
58
57
      }
59
58
    } while ((schema_ptr= schema_generator) && table_setup());
61
60
    return message::table::shared_ptr();
62
61
  }
63
62
 
64
 
  operator const drizzled::TableIdentifier*()
 
63
  operator const drizzled::identifier::Table*()
65
64
  {
66
65
    do {
67
66
      while (table_iterator != table_names.end())
68
67
      {
69
 
        const drizzled::TableIdentifier *_ptr= &(*table_iterator);
 
68
        const drizzled::identifier::Table *_ptr= &(*table_iterator);
70
69
        table_iterator++;
71
70
 
72
71
        return _ptr;
80
79
} /* namespace generator */
81
80
} /* namespace drizzled */
82
81
 
83
 
#endif /* DRIZZLED_GENERATOR_ALL_TABLES_H */