~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_dictionary/schemas.h

retrieve data from the local cache

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2010 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2010 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
21
21
#ifndef PLUGIN_SCHEMA_DICTIONARY_SCHEMAS_H
22
22
#define PLUGIN_SCHEMA_DICTIONARY_SCHEMAS_H
23
23
 
24
 
class SchemasTool : public DataDictionary
 
24
class SchemasTool : public drizzled::plugin::TableFunction
25
25
{
26
26
public:
27
27
 
28
28
  SchemasTool();
29
29
 
30
 
  class Generator : public DataDictionary::Generator 
 
30
  SchemasTool(const char *schema_arg, const char *table_arg) :
 
31
    drizzled::plugin::TableFunction(schema_arg, table_arg)
 
32
  { }
 
33
 
 
34
  SchemasTool(const char *table_arg) :
 
35
    drizzled::plugin::TableFunction("DATA_DICTIONARY", table_arg)
 
36
  { }
 
37
 
 
38
  class Generator : public drizzled::plugin::TableFunction::Generator 
31
39
  {
32
 
    drizzled::generator::Schema schema_generator;
 
40
    drizzled::message::Schema schema;
 
41
 
 
42
    drizzled::SchemaIdentifierList schema_names;
 
43
    drizzled::SchemaIdentifierList::const_iterator schema_iterator;
 
44
 
 
45
    bool is_schema_primed;
 
46
    bool is_schema_parsed;
 
47
 
 
48
    virtual void fill();
33
49
 
34
50
  public:
35
51
    Generator(drizzled::Field **arg);
36
52
 
 
53
    const std::string &schema_name()
 
54
    {
 
55
      assert(is_schema_primed);
 
56
      return schema.name();
 
57
    }
 
58
 
37
59
    bool populate();
 
60
    bool nextSchemaCore();
 
61
    bool nextSchema();
 
62
    bool isSchemaPrimed()
 
63
    {
 
64
      return is_schema_primed;
 
65
    }
38
66
  };
39
67
 
40
68
  Generator *generator(drizzled::Field **arg)