Drizzled Public API Documentation

transaction_applier.h
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2008-2009 Sun Microsystems, Inc.
00005  *  Copyright (C) 2010 Jay Pipes
00006  *
00007  *  Authors:
00008  *
00009  *    Jay Pipes <jaypipes@gmail.com>
00010  *
00011  *  This program is free software; you can redistribute it and/or modify
00012  *  it under the terms of the GNU General Public License as published by
00013  *  the Free Software Foundation; version 2 of the License.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public License
00021  *  along with this program; if not, write to the Free Software
00022  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00023  */
00024 
00025 #pragma once
00026 
00035 #include <drizzled/plugin/plugin.h>
00036 #include <drizzled/plugin/replication.h>
00037 
00038 #include <drizzled/visibility.h>
00039 
00040 namespace drizzled
00041 {
00042 
00043 class Session;
00044 
00045 namespace message { class Transaction; }
00046 
00047 namespace plugin
00048 {
00049 
00053 class DRIZZLED_API TransactionApplier : public Plugin
00054 {
00055   TransactionApplier();
00056   TransactionApplier(const TransactionApplier &);
00057   TransactionApplier& operator=(const TransactionApplier &);
00058 public:
00059   explicit TransactionApplier(std::string name_arg)
00060     : Plugin(name_arg, "TransactionApplier")
00061   {
00062   }
00063   virtual ~TransactionApplier() {}
00079   virtual ReplicationReturnCode apply(Session &in_session,
00080                                       const message::Transaction &to_apply)= 0;
00081 
00082   static bool addPlugin(TransactionApplier *applier);
00083   static void removePlugin(TransactionApplier *applier);
00084 };
00085 
00086 } /* namespace plugin */
00087 } /* namespace drizzled */
00088