1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2010 Brian Aker
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.
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.
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
22
#ifndef DRIZZLED_PLUGIN_CATALOG_H
23
#define DRIZZLED_PLUGIN_CATALOG_H
25
#include <drizzled/plugin/plugin.h>
26
#include <drizzled/identifier.h>
27
#include <drizzled/catalog/instance.h>
28
#include <drizzled/catalog/engine.h>
35
class Catalog : public Plugin {
36
/* Disable default constructors */
38
Catalog(const Catalog &);
39
Catalog& operator=(const Catalog &);
42
typedef std::vector<Catalog *> vector;
44
explicit Catalog(std::string name_arg) :
45
Plugin(name_arg, "Catalog")
49
virtual catalog::Engine::shared_ptr engine()= 0;
51
static bool create(const identifier::Catalog &);
52
static bool create(const identifier::Catalog &, message::catalog::shared_ptr &);
53
static bool drop(const identifier::Catalog &);
55
static bool lock(const identifier::Catalog &);
56
static bool unlock(const identifier::Catalog &);
58
// Required for plugin interface
59
static bool addPlugin(plugin::Catalog *plugin);
60
static void removePlugin(plugin::Catalog *plugin);
62
// Get Meta information
63
static bool exist(const identifier::Catalog &identifier);
64
static void getIdentifiers(identifier::Catalog::vector &identifiers);
65
static void getMessages(message::catalog::vector &messages);
66
static bool getMessage(const identifier::Catalog &identifier, message::catalog::shared_ptr &message);
69
static catalog::Instance::shared_ptr getInstance(const identifier::Catalog &identifier);
72
} /* namespace plugin */
73
} /* namespace drizzled */
75
#endif /* DRIZZLED_PLUGIN_CATALOG_H */