~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/generator/schema.h

  • Committer: Patrick Crews
  • Date: 2010-12-07 20:02:50 UTC
  • Revision ID: gleebix@gmail.com-20101207200250-6a27jgqalgw5bsb5
Added disabled.def file to disable drizzleslap due to Bug#684269.  Need to skip for tarball release this round

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef DRIZZLED_GENERATOR_SCHEMA_H
22
22
#define DRIZZLED_GENERATOR_SCHEMA_H
23
23
 
24
 
#include <drizzled/plugin/authorization.h>
25
 
#include <drizzled/plugin/storage_engine.h>
 
24
#include "drizzled/session.h"
 
25
#include "drizzled/plugin/storage_engine.h"
26
26
 
27
27
namespace drizzled {
28
 
 
29
 
class Session;
30
 
 
31
28
namespace generator {
32
29
 
33
30
class Schema
35
32
  Session &session;
36
33
  message::schema::shared_ptr schema;
37
34
 
38
 
  identifier::Schema::vector schema_names;
39
 
  identifier::Schema::vector::const_iterator schema_iterator;
 
35
  SchemaIdentifier::vector schema_names;
 
36
  SchemaIdentifier::vector::const_iterator schema_iterator;
40
37
 
41
38
public:
42
39
 
43
40
  Schema(Session &arg);
44
41
 
45
 
  operator const drizzled::message::schema::shared_ptr();
46
 
  operator const drizzled::identifier::Schema*();
 
42
  operator const drizzled::message::schema::shared_ptr()
 
43
  {
 
44
    while (schema_iterator != schema_names.end())
 
45
    {
 
46
      SchemaIdentifier schema_identifier(*schema_iterator);
 
47
      bool is_schema_parsed= plugin::StorageEngine::getSchemaDefinition(schema_identifier, schema);
 
48
      schema_iterator++;
 
49
 
 
50
      if (is_schema_parsed)
 
51
        return schema;
 
52
    }
 
53
 
 
54
    return message::schema::shared_ptr();
 
55
  }
 
56
 
 
57
  operator const drizzled::SchemaIdentifier*()
 
58
  {
 
59
    while (schema_iterator != schema_names.end())
 
60
    {
 
61
      const drizzled::SchemaIdentifier *_ptr= &(*schema_iterator);
 
62
      schema_iterator++;
 
63
 
 
64
      return _ptr;
 
65
    }
 
66
 
 
67
    return NULL;
 
68
  }
47
69
};
48
70
 
49
71
} /* namespace generator */