~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/transaction_applier.h

Remove dead memset call.

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
5
6
 *
6
7
 *  Authors:
7
8
 *
8
 
 *    Jay Pipes <joinfu@sun.com>
 
9
 *    Jay Pipes <jaypipes@gmail.com>
9
10
 *
10
11
 *  This program is free software; you can redistribute it and/or modify
11
12
 *  it under the terms of the GNU General Public License as published by
33
34
 */
34
35
 
35
36
#include "drizzled/plugin/plugin.h"
36
 
#include "drizzled/atomics.h"
 
37
#include "drizzled/plugin/replication.h"
37
38
 
38
39
namespace drizzled
39
40
{
40
41
 
 
42
class Session;
 
43
 
41
44
namespace message { class Transaction; }
42
45
 
43
46
namespace plugin
51
54
  TransactionApplier();
52
55
  TransactionApplier(const TransactionApplier &);
53
56
  TransactionApplier& operator=(const TransactionApplier &);
54
 
  atomic<bool> is_enabled;
55
57
public:
56
58
  explicit TransactionApplier(std::string name_arg)
57
59
    : Plugin(name_arg, "TransactionApplier")
58
60
  {
59
 
    is_enabled= true;
60
61
  }
61
62
  virtual ~TransactionApplier() {}
62
63
  /**
74
75
   *
75
76
   * @param Transaction message to be replicated
76
77
   */
77
 
  virtual void apply(const message::Transaction &to_apply)= 0;
 
78
  virtual ReplicationReturnCode apply(Session &in_session,
 
79
                                      const message::Transaction &to_apply)= 0;
78
80
 
79
81
  static bool addPlugin(TransactionApplier *applier);
80
82
  static void removePlugin(TransactionApplier *applier);
81
 
  virtual bool isEnabled() const
82
 
  {
83
 
    return is_enabled;
84
 
  }
85
 
 
86
 
  virtual void enable()
87
 
  {
88
 
    is_enabled= true;
89
 
  }
90
 
 
91
 
  virtual void disable()
92
 
  {
93
 
    is_enabled= false;
94
 
  }
95
83
};
96
84
 
97
85
} /* namespace plugin */