~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/transaction_applier.h

  • Committer: Monty Taylor
  • Date: 2010-01-02 05:11:55 UTC
  • mto: (1259.3.1 build)
  • mto: This revision was merged to the branch mainline in revision 1262.
  • Revision ID: mordred@inaugust.com-20100102051155-akdm8w5rr6xwzayu
pandora-build - proper detection of memcached.

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
34
33
 */
35
34
 
36
35
#include "drizzled/plugin/plugin.h"
37
 
#include "drizzled/plugin/replication.h"
 
36
#include "drizzled/atomics.h"
38
37
 
39
38
namespace drizzled
40
39
{
41
40
 
42
 
class Session;
43
 
 
44
41
namespace message { class Transaction; }
45
42
 
46
43
namespace plugin
54
51
  TransactionApplier();
55
52
  TransactionApplier(const TransactionApplier &);
56
53
  TransactionApplier& operator=(const TransactionApplier &);
 
54
  atomic<bool> is_enabled;
57
55
public:
58
56
  explicit TransactionApplier(std::string name_arg)
59
57
    : Plugin(name_arg, "TransactionApplier")
60
58
  {
 
59
    is_enabled= true;
61
60
  }
62
61
  virtual ~TransactionApplier() {}
63
62
  /**
75
74
   *
76
75
   * @param Transaction message to be replicated
77
76
   */
78
 
  virtual ReplicationReturnCode apply(Session &in_session,
79
 
                                      const message::Transaction &to_apply)= 0;
 
77
  virtual void apply(const message::Transaction &to_apply)= 0;
80
78
 
81
79
  static bool addPlugin(TransactionApplier *applier);
82
80
  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
  }
83
95
};
84
96
 
85
97
} /* namespace plugin */