~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/error_message.h

Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
3
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
 
 
 
3
 *
5
4
 *  Definitions required for Error Message plugin
6
 
 
 
5
 *
7
6
 *  Copyright (C) 2008 Sun Microsystems
8
7
 *
9
8
 *  This program is free software; you can redistribute it and/or modify
20
19
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21
20
 */
22
21
 
23
 
#ifndef DRIZZLED_PLUGIN_ERRMSG_H
24
 
#define DRIZZLED_PLUGIN_ERRMSG_H
 
22
#ifndef DRIZZLED_PLUGIN_ERROR_MESSAGE_H
 
23
#define DRIZZLED_PLUGIN_ERROR_MESSAGE_H
25
24
 
26
25
#include <stdarg.h>
27
26
#include <string>
28
27
 
29
 
class Error_message_handler
 
28
namespace drizzled
 
29
{
 
30
namespace plugin
 
31
{
 
32
 
 
33
class ErrorMessage
30
34
{
31
35
  std::string name;
32
36
public:
33
 
  Error_message_handler(std::string name_arg): name(name_arg) {}
34
 
  Error_message_handler(const char *name_arg): name(name_arg) {}
35
 
  virtual ~Error_message_handler() {}
 
37
  ErrorMessage(std::string name_arg): name(name_arg) {}
 
38
  virtual ~ErrorMessage() {}
36
39
 
37
40
  std::string getName() { return name; }
38
41
 
39
42
  virtual bool errmsg(Session *session, int priority,
40
43
                      const char *format, va_list ap)=0;
 
44
 
 
45
  static bool addPlugin(plugin::ErrorMessage *handler);
 
46
  static void removePlugin(plugin::ErrorMessage *handler);
 
47
 
 
48
  static bool vprintf(Session *session, int priority, char const *format,
 
49
                      va_list ap);
41
50
};
42
51
 
43
 
#endif /* DRIZZLED_PLUGIN_ERRMSG_H */
 
52
} /* namespace plugin */
 
53
} /* namespace drizzled */
 
54
 
 
55
#endif /* DRIZZLED_PLUGIN_ERROR_MESSAGE_H */