~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/logging_handler.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-08-08 04:22:33 UTC
  • mto: (1115.3.4 captain)
  • mto: This revision was merged to the branch mainline in revision 1117.
  • Revision ID: osullivan.padraig@gmail.com-20090808042233-q0z88zc490z3f3r7
Renamed the Command class to be Statement. Renamed the command directory to
statement and also the command header file to statement. Updated various
source files to reflect this renaming.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
1
/*
 
2
 -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
3
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
 
4
 
4
5
 *  Definitions required for Query Logging plugin
5
 
 *
 
6
 
6
7
 *  Copyright (C) 2008 Sun Microsystems
7
8
 *
8
9
 *  This program is free software; you can redistribute it and/or modify
22
23
#ifndef DRIZZLED_PLUGIN_LOGGING_H
23
24
#define DRIZZLED_PLUGIN_LOGGING_H
24
25
 
25
 
#include "drizzled/plugin/plugin.h"
26
 
 
27
26
#include <string>
28
27
 
29
 
namespace drizzled
30
 
{
31
 
class Session;
32
 
 
33
 
namespace plugin
34
 
{
35
 
 
36
 
class Logging : public Plugin
37
 
{
38
 
  Logging();
39
 
  Logging(const Logging &);
40
 
  Logging& operator=(const Logging &);
 
28
class Logging_handler
 
29
{
 
30
  std::string name;
41
31
public:
42
 
  explicit Logging(std::string name_arg)
43
 
    : Plugin(name_arg, "Logging")
44
 
  {}
45
 
  virtual ~Logging() {}
 
32
  Logging_handler(std::string name_arg): name(name_arg)  {}
 
33
  Logging_handler(const char *name_arg): name(name_arg)  {}
 
34
  virtual ~Logging_handler() {}
46
35
 
 
36
  std::string getName() { return name; }
47
37
  /**
48
38
   * Make these no-op rather than pure-virtual so that it's easy for a plugin
49
 
   * to only implement one.
 
39
   * to only 
50
40
   */
51
41
  virtual bool pre(Session *) {return false;}
52
42
  virtual bool post(Session *) {return false;}
53
 
  virtual bool postEnd(Session*) {return false;}
54
 
 
55
 
  static bool addPlugin(Logging *handler);
56
 
  static void removePlugin(Logging *handler);
57
 
  static bool preDo(Session *session);
58
 
  static bool postDo(Session *session);
59
 
  static bool postEndDo(Session *session);
60
43
};
61
44
 
62
 
} /* namespace plugin */
63
 
} /* namespace drizzled */
64
 
 
65
45
#endif /* DRIZZLED_PLUGIN_LOGGING_H */