1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008-2009 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
* Defines the API of a simple reader of Command messages from the
29
* This class is used by other plugins, for instance
30
* the async_replication module, in order to read the command log and
31
* return Command messages.
34
#ifndef DRIZZLE_PLUGIN_COMMAND_LOG_READER_H
35
#define DRIZZLE_PLUGIN_COMMAND_LOG_READER_H
37
#include "command_log.h"
39
#include <drizzled/server_includes.h>
40
#include <drizzled/plugin/command_reader.h>
43
* A class which reads Command messages from the Command log file
45
class CommandLogReader :public drizzled::plugin::CommandReader
48
/** The Command log object this reader uses */
49
const CommandLog &log;
51
CommandLogReader(const CommandLog &in_log)
56
~CommandLogReader() {}
58
* Read and fill a Command message with the supplied
59
* Command message global transaction ID.
61
* @param[in] Global transaction ID to find
62
* @param[out] Pointer to a command message to fill
65
* true if Command message was read successfully and the supplied pointer to message was filled
67
* false if not found or read successfully
69
bool read(const drizzled::ReplicationServices::GlobalTransactionId &to_read_trx_id,
70
drizzled::message::Command *to_fill);
73
#endif /* DRIZZLE_PLUGIN_COMMAND_LOG_READER_H */