Drizzled Public API Documentation

query_rewrite.h
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2010 Padraig O'Sullivan
00005  *
00006  *  Authors:
00007  *
00008  *    Padraig O'Sullivan <posullivan@akibainc.com>
00009  *
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; version 2 of the License.
00013  *
00014  *  This program is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU General Public License
00020  *  along with this program; if not, write to the Free Software
00021  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
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 } /* namespace plugin */
00087 
00088 } /* namespace drizzled */
00089