00001 /* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*- 00002 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 00003 * 00004 * Copyright (C) 00005 * 00006 * Authors: 00007 * Jay Pipes <joinfu@sun.com> 00008 * Joseph Daly <skinny.moey@gmail.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; either version 2 of the License, or 00013 * (at your option) any later version. 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 00027 #include <drizzled/plugin/table_function.h> 00028 #include <drizzled/field.h> 00029 00030 #include "transaction_log.h" 00031 00032 class TransactionLogTool : public drizzled::plugin::TableFunction 00033 { 00034 public: 00035 00036 TransactionLogTool(); 00037 00038 class Generator : public drizzled::plugin::TableFunction::Generator 00039 { 00040 public: 00041 Generator(drizzled::Field **arg); 00042 00043 bool populate(); 00044 private: 00045 bool is_done; 00046 }; 00047 00048 Generator *generator(drizzled::Field **arg) 00049 { 00050 return new Generator(arg); 00051 } 00052 }; 00053 00054 class TransactionLogEntriesTool : public drizzled::plugin::TableFunction 00055 { 00056 public: 00057 00058 TransactionLogEntriesTool(); 00059 00060 class Generator : public drizzled::plugin::TableFunction::Generator 00061 { 00062 public: 00063 Generator(drizzled::Field **arg); 00064 00065 bool populate(); 00066 private: 00067 TransactionLog::Entries::iterator it; 00068 TransactionLog::Entries::iterator end; 00069 }; 00070 00071 Generator *generator(drizzled::Field **arg) 00072 { 00073 return new Generator(arg); 00074 } 00075 }; 00076 00077 class TransactionLogTransactionsTool : public drizzled::plugin::TableFunction 00078 { 00079 public: 00080 00081 TransactionLogTransactionsTool(); 00082 00083 class Generator : public drizzled::plugin::TableFunction::Generator 00084 { 00085 public: 00086 Generator(drizzled::Field **arg); 00087 00088 bool populate(); 00089 private: 00090 TransactionLog::TransactionEntries::iterator it; 00091 TransactionLog::TransactionEntries::iterator end; 00092 }; 00093 00094 Generator *generator(drizzled::Field **arg) 00095 { 00096 return new Generator(arg); 00097 } 00098 }; 00099