~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/generator/table.h

  • Committer: Stewart Smith
  • Date: 2008-10-15 04:21:24 UTC
  • mto: This revision was merged to the branch mainline in revision 516.
  • Revision ID: stewart@flamingspork.com-20081015042124-kdmb74bcbky1k1nz
remove my_pthread_[gs]etspecific

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2010 Brian Aker
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; either version 2 of the License, or
9
 
 *  (at your option) any later version.
10
 
 *
11
 
 *  This program is distributed in the hope that it will be useful,
12
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 *  GNU General Public License for more details.
15
 
 *
16
 
 *  You should have received a copy of the GNU General Public License
17
 
 *  along with this program; if not, write to the Free Software
18
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 
 */
20
 
 
21
 
#ifndef DRIZZLED_GENERATOR_TABLE_H
22
 
#define DRIZZLED_GENERATOR_TABLE_H
23
 
 
24
 
#include <drizzled/plugin/storage_engine.h>
25
 
 
26
 
namespace drizzled {
27
 
 
28
 
class Session;
29
 
 
30
 
namespace generator {
31
 
 
32
 
class Table
33
 
{
34
 
  Session &session;
35
 
 
36
 
  identifier::Table::vector table_names;
37
 
  identifier::Table::vector::const_iterator table_iterator;
38
 
 
39
 
public:
40
 
 
41
 
  Table(Session &arg, const identifier::Schema &schema_identifier);
42
 
 
43
 
  operator const drizzled::message::table::shared_ptr()
44
 
  {
45
 
    while (table_iterator != table_names.end())
46
 
    {
47
 
      message::table::shared_ptr table;
48
 
      table= plugin::StorageEngine::getTableMessage(session, *table_iterator);
49
 
      table_iterator++;
50
 
 
51
 
      if (table)
52
 
        return table;
53
 
    }
54
 
 
55
 
    return message::table::shared_ptr();
56
 
  }
57
 
 
58
 
  operator const drizzled::identifier::Table*()
59
 
  {
60
 
    while (table_iterator != table_names.end())
61
 
    {
62
 
      const drizzled::identifier::Table *_ptr= &(*table_iterator);
63
 
      table_iterator++;
64
 
 
65
 
      return _ptr;
66
 
    }
67
 
 
68
 
    return NULL;
69
 
  }
70
 
};
71
 
 
72
 
} /* namespace generator */
73
 
} /* namespace drizzled */
74
 
 
75
 
#endif /* DRIZZLED_GENERATOR_TABLE_H */