~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/command_replicator.h

  • Committer: Monty Taylor
  • Date: 2009-10-13 06:17:38 UTC
  • mto: (1130.3.33 memory-file-moves)
  • mto: This revision was merged to the branch mainline in revision 1184.
  • Revision ID: mordred@inaugust.com-20091013061738-rv5pmqulng8rfvjn
Removed runtime active flag from plugin::Plugin. Put a runtime enabled flag on CommandApplier and CommandReplicator - we can refactor this down into plugin::Plugin later if we need to.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#ifndef DRIZZLED_PLUGIN_COMMAND_REPLICATOR_H
25
25
#define DRIZZLED_PLUGIN_COMMAND_REPLICATOR_H
26
26
 
 
27
#include "drizzled/atomics.h"
 
28
 
27
29
/**
28
30
 * @file Defines the API for a CommandReplicator.  
29
31
 *
51
53
  CommandReplicator();
52
54
  CommandReplicator(const CommandReplicator &);
53
55
  CommandReplicator& operator=(const CommandReplicator &);
 
56
  atomic<bool> is_enabled;
 
57
 
54
58
public:
55
59
  explicit CommandReplicator(std::string name_arg)
56
 
   : Plugin(name_arg)
57
 
  {}
 
60
    : Plugin(name_arg)
 
61
  {
 
62
    is_enabled= true;
 
63
  }
 
64
 
58
65
  virtual ~CommandReplicator() {}
59
66
  /**
60
67
   * Replicate a Command message to a CommandApplier.
74
81
   */
75
82
  virtual void replicate(CommandApplier *in_applier, 
76
83
                         message::Command &to_replicate)= 0;
 
84
 
 
85
  virtual bool isEnabled() const
 
86
  {
 
87
    return is_enabled;
 
88
  }
 
89
 
 
90
  virtual void enable()
 
91
  {
 
92
    is_enabled= true;
 
93
  }
 
94
 
 
95
  virtual void disable()
 
96
  {
 
97
    is_enabled= false;
 
98
  }
 
99
 
77
100
  static bool addPlugin(CommandReplicator *replicator);
78
101
  static void removePlugin(CommandReplicator *replicator);
79
102
};