00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #pragma once
00025
00026 #include <drizzled/atomics.h>
00027 #include <drizzled/plugin/plugin.h>
00028
00029 #include <drizzled/visibility.h>
00030
00035 namespace drizzled
00036 {
00037
00038 namespace plugin
00039 {
00040
00044 class DRIZZLED_API QueryRewriter : public Plugin
00045 {
00046
00047 public:
00048
00049 explicit QueryRewriter(std::string name_arg)
00050 :
00051 Plugin(name_arg, "QueryRewriter")
00052 {}
00053
00054 virtual ~QueryRewriter() {}
00055
00062 virtual void rewrite(const std::string &schema, std::string &to_rewrite)= 0;
00063
00064 static bool addPlugin(QueryRewriter *in_rewriter);
00065 static void removePlugin(QueryRewriter *in_rewriter);
00066
00075 static void rewriteQuery(const std::string &schema, std::string &to_rewrite);
00076
00077 private:
00078
00079 QueryRewriter();
00080 QueryRewriter(const QueryRewriter&);
00081 QueryRewriter& operator=(const QueryRewriter&);
00082
00083
00084 };
00085
00086 }
00087
00088 }
00089