~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_engine/schema.h

  • Committer: Brian Aker
  • Date: 2010-09-22 22:25:29 UTC
  • mto: (1791.1.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 1792.
  • Revision ID: brian@tangent.org-20100922222529-geo4wggmu5ntqa5k
Current boost work (more conversion).

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include <assert.h>
25
25
#include <drizzled/plugin/storage_engine.h>
 
26
#include <drizzled/data_home.h>
26
27
#include <boost/unordered_map.hpp>
27
28
#include <boost/thread/shared_mutex.hpp>
28
29
 
34
35
 
35
36
class Schema : public drizzled::plugin::StorageEngine
36
37
{
37
 
  bool writeSchemaFile(const drizzled::identifier::Schema &schema_identifier, const drizzled::message::Schema &db);
38
 
  bool readSchemaFile(const drizzled::identifier::Schema &schema_identifier, drizzled::message::Schema &schema);
39
 
  bool readSchemaFile(std::string filename, drizzled::message::Schema &schema);
 
38
  bool writeSchemaFile(const drizzled::SchemaIdentifier &schema_identifier, const drizzled::message::Schema &db);
 
39
  bool readSchemaFile(const drizzled::SchemaIdentifier &schema_identifier, drizzled::message::Schema &schema);
40
40
 
41
41
  void prime();
42
 
  void startup(drizzled::Session &session);
43
42
 
44
 
  typedef boost::unordered_map<std::string, drizzled::message::schema::shared_ptr> SchemaCache;
 
43
  typedef boost::unordered_map<std::string, drizzled::message::Schema> SchemaCache;
45
44
  SchemaCache schema_cache;
46
45
  bool schema_cache_filled;
47
46
 
53
52
  ~Schema();
54
53
 
55
54
 
56
 
  drizzled::Cursor *create(drizzled::Table &)
 
55
  bool doCanCreateTable(const drizzled::TableIdentifier &identifier);
 
56
 
 
57
  drizzled::Cursor *create(drizzled::TableShare &)
57
58
  {
58
59
    return NULL;
59
60
  }
60
61
 
61
 
  void doGetSchemaIdentifiers(drizzled::identifier::Schema::vector &set_of_names);
62
 
  bool doGetSchemaDefinition(const drizzled::identifier::Schema&, drizzled::message::schema::shared_ptr &proto);
 
62
  void doGetSchemaIdentifiers(drizzled::SchemaIdentifiers &set_of_names);
 
63
  bool doGetSchemaDefinition(const drizzled::SchemaIdentifier&, drizzled::message::Schema &proto);
63
64
 
64
65
  bool doCreateSchema(const drizzled::message::Schema &schema_message);
65
66
 
66
67
  bool doAlterSchema(const drizzled::message::Schema &schema_message);
67
68
 
68
 
  bool doDropSchema(const drizzled::identifier::Schema&);
 
69
  bool doDropSchema(const drizzled::SchemaIdentifier&);
69
70
 
70
71
  // Below are table methods that we don't implement (and don't need)
71
72
 
72
73
  int doGetTableDefinition(drizzled::Session&,
73
 
                           const drizzled::identifier::Table&,
 
74
                           const drizzled::TableIdentifier&,
74
75
                           drizzled::message::Table&)
75
76
  {
76
77
    return ENOENT;
77
78
  }
78
79
 
79
 
  bool doDoesTableExist(drizzled::Session&, const drizzled::identifier::Table&)
 
80
  bool doDoesTableExist(drizzled::Session&, const drizzled::TableIdentifier&)
80
81
  {
81
82
    return false;
82
83
  }
83
84
 
84
 
  int doRenameTable(drizzled::Session&, const drizzled::identifier::Table&, const drizzled::identifier::Table&)
 
85
  int doRenameTable(drizzled::Session&, const drizzled::TableIdentifier&, const drizzled::TableIdentifier&)
85
86
  {
86
 
    return drizzled::HA_ERR_NO_SUCH_TABLE;
 
87
    return EPERM;
87
88
  }
88
89
 
89
90
  int doCreateTable(drizzled::Session&,
90
91
                    drizzled::Table&,
91
 
                    const drizzled::identifier::Table&,
 
92
                    const drizzled::TableIdentifier&,
92
93
                    drizzled::message::Table&)
93
94
  {
94
 
    return drizzled::ER_TABLE_PERMISSION_DENIED;
 
95
    return EPERM;
95
96
  }
96
97
 
97
 
  int doDropTable(drizzled::Session&, const drizzled::identifier::Table&)
 
98
  int doDropTable(drizzled::Session&, const drizzled::TableIdentifier&)
98
99
  {
99
 
    return drizzled::HA_ERR_NO_SUCH_TABLE;
 
100
    return 0;
100
101
  }
101
102
 
102
103
  const char **bas_ext() const 
109
110
                          uint64_t *,
110
111
                          uint64_t *)
111
112
  {}
112
 
 
113
113
  void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
114
 
                             const drizzled::identifier::Schema &schema_identifier,
115
 
                             drizzled::identifier::Table::vector &set_of_identifiers);
 
114
                             const drizzled::SchemaIdentifier &schema_identifier,
 
115
                             drizzled::TableIdentifiers &set_of_identifiers);
116
116
};
117
117
 
118
118
#endif /* PLUGIN_SCHEMA_ENGINE_SCHEMA_H */