00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023
00024 #include <drizzled/plugin/plugin.h>
00025 #include <drizzled/identifier.h>
00026 #include <drizzled/catalog/instance.h>
00027 #include <drizzled/catalog/engine.h>
00028
00029 #include <drizzled/visibility.h>
00030
00031 namespace drizzled
00032 {
00033 namespace plugin
00034 {
00035
00036
00037
00038
00039 class DRIZZLED_API Catalog : public Plugin
00040 {
00041 public:
00042 typedef std::vector<Catalog *> vector;
00043
00044 explicit Catalog(std::string name_arg) :
00045 Plugin(name_arg, "Catalog")
00046 {}
00047
00048 virtual catalog::Engine::shared_ptr engine()= 0;
00049
00050 static bool create(const identifier::Catalog&);
00051 static bool create(const identifier::Catalog&, message::catalog::shared_ptr &);
00052 static bool drop(const identifier::Catalog&);
00053
00054 static bool lock(const identifier::Catalog&);
00055 static bool unlock(const identifier::Catalog&);
00056
00057
00058 static bool addPlugin(plugin::Catalog *plugin);
00059 static void removePlugin(plugin::Catalog *plugin);
00060
00061
00062 static bool exist(const identifier::Catalog&);
00063 static void getIdentifiers(identifier::catalog::vector &identifiers);
00064 static void getMessages(message::catalog::vector &messages);
00065 static message::catalog::shared_ptr getMessage(const identifier::Catalog&);
00066
00067
00068 static catalog::Instance::shared_ptr getInstance(const identifier::Catalog&);
00069 };
00070
00071 }
00072 }
00073