~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/command_applier.h

Style cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
4
 *  Copyright (C) 2008-2009 Sun Microsystems
5
 
 *  Copyright (c) 2010 Jay Pipes
6
5
 *
7
6
 *  Authors:
8
7
 *
9
 
 *    Jay Pipes <jaypipes@gmail.com>
 
8
 *    Jay Pipes <joinfu@sun.com>
10
9
 *
11
10
 *  This program is free software; you can redistribute it and/or modify
12
11
 *  it under the terms of the GNU General Public License as published by
22
21
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23
22
 */
24
23
 
25
 
#ifndef DRIZZLED_PLUGIN_TRANSACTION_APPLIER_H
26
 
#define DRIZZLED_PLUGIN_TRANSACTION_APPLIER_H
 
24
#ifndef DRIZZLED_PLUGIN_COMMAND_APPLIER_H
 
25
#define DRIZZLED_PLUGIN_COMMAND_APPLIER_H
27
26
 
28
27
/**
29
 
 * @file Defines the API for a TransactionApplier
 
28
 * @file Defines the API for a CommandApplier
30
29
 *
31
 
 * A TransactionApplier applies an event it has received from a TransactionReplicator (via 
32
 
 * a replicator's replicate() call, or it has read using a TransactionReader's read()
 
30
 * A CommandApplier applies an event it has received from a CommandReplicator (via 
 
31
 * a replicator's replicate() call, or it has read using a CommandReader's read()
33
32
 * call.
34
33
 */
35
34
 
36
35
#include "drizzled/plugin/plugin.h"
37
 
#include "drizzled/plugin/replication.h"
38
36
 
39
37
namespace drizzled
40
38
{
41
39
 
42
 
class Session;
43
 
 
44
 
namespace message { class Transaction; }
 
40
namespace message { class Command; }
45
41
 
46
42
namespace plugin
47
43
{
48
44
 
49
45
/**
50
 
 * Base class for appliers of Transaction messages
 
46
 * Base class for appliers of Command messages
51
47
 */
52
 
class TransactionApplier : public Plugin
 
48
class CommandApplier : public Plugin
53
49
{
54
 
  TransactionApplier();
55
 
  TransactionApplier(const TransactionApplier &);
56
 
  TransactionApplier& operator=(const TransactionApplier &);
 
50
  CommandApplier();
 
51
  CommandApplier(const CommandApplier &);
 
52
  CommandApplier& operator=(const CommandApplier &);
57
53
public:
58
 
  explicit TransactionApplier(std::string name_arg)
59
 
    : Plugin(name_arg, "TransactionApplier")
60
 
  {
61
 
  }
62
 
  virtual ~TransactionApplier() {}
 
54
  explicit CommandApplier(std::string name_arg) : Plugin(name_arg) {}
 
55
  virtual ~CommandApplier() {}
63
56
  /**
64
57
   * Apply something to a target.
65
58
   *
73
66
   * the supplied message to their own controlled memory storage
74
67
   * area.
75
68
   *
76
 
   * @param Transaction message to be replicated
 
69
   * @param Command message to be replicated
77
70
   */
78
 
  virtual ReplicationReturnCode apply(Session &in_session,
79
 
                                      const message::Transaction &to_apply)= 0;
 
71
  virtual void apply(const message::Command &to_apply)= 0;
80
72
 
81
 
  static bool addPlugin(TransactionApplier *applier);
82
 
  static void removePlugin(TransactionApplier *applier);
 
73
  static bool addPlugin(CommandApplier *applier);
 
74
  static void removePlugin(CommandApplier *applier);
83
75
};
84
76
 
85
77
} /* namespace plugin */
86
78
} /* namespace drizzled */
87
79
 
88
 
#endif /* DRIZZLED_PLUGIN_TRANSACTION_APPLIER_H */
 
80
#endif /* DRIZZLED_PLUGIN_APPLIER_H */