21
21
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
#ifndef DRIZZLED_PLUGIN_COMMAND_READER_H
25
#define DRIZZLED_PLUGIN_COMMAND_READER_H
24
#ifndef DRIZZLED_PLUGIN_TRANSACTION_READER_H
25
#define DRIZZLED_PLUGIN_TRANSACTION_READER_H
27
27
#include <drizzled/replication_services.h> /* For global transaction ID typedef */
30
* @file Defines the API for a CommandReader
30
* @file Defines the API for a TransactionReader
32
* A command reader is a class which is able to read Command messages from some source
32
* A command reader is a class which is able to read Transaction messages from some source
37
/* some forward declarations needed */
38
namespace message { class Command; }
37
namespace message { class Transaction; }
45
* Class which can read Command messages from some source
44
* Class which can read Transaction messages from some source
47
class CommandReader : public Plugin
46
class TransactionReader : public Plugin
50
CommandReader(const CommandReader &);
51
CommandReader& operator=(const CommandReader &);
49
TransactionReader(const TransactionReader &);
50
TransactionReader& operator=(const TransactionReader &);
53
explicit CommandReader(std::string name_arg) : Plugin(name_arg) {}
54
virtual ~CommandReader() {}
52
explicit TransactionReader(std::string name_arg)
53
: Plugin(name_arg, "TransactionReader") {}
54
virtual ~TransactionReader() {}
56
* Read and fill a Command message with the supplied
57
* Command message global transaction ID.
56
* Read and fill a Transaction message with the supplied
57
* Transaction message global transaction ID.
59
59
* @param Global transaction ID to find
60
60
* @param Pointer to a command message to fill
63
* true if Command message was read successfully and the supplied pointer
63
* true if Transaction message was read successfully and the supplied pointer
64
64
* to message was filled
66
66
* false if not found or read successfully
68
68
virtual bool read(const ReplicationServices::GlobalTransactionId &to_read,
69
message::Command *to_fill)= 0;
69
message::Transaction *to_fill)= 0;
72
72
} /* end namespace drizzled::plugin */
73
73
} /* end namespace drizzled */
75
#endif /* DRIZZLED_PLUGIN_COMMAND_READER_H */
75
#endif /* DRIZZLED_PLUGIN_TRANSACTION_READER_H */