~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/slot/error_message.h

Merged in plugin-slot-reorg patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_ERRMSG_H
21
 
#define DRIZZLED_ERRMSG_H
22
 
 
23
 
#include <drizzled/plugin/error_message_handler.h>
 
20
#ifndef DRIZZLED_SLOT_ERROR_MESSAGE_H
 
21
#define DRIZZLED_SLOT_ERROR_MESSAGE_H
24
22
 
25
23
// need stdarg for va_list
26
24
#include <stdarg.h>
27
 
 
28
 
void add_errmsg_handler(Error_message_handler *handler);
29
 
void remove_errmsg_handler(Error_message_handler *handler);
30
 
 
31
 
bool errmsg_vprintf (Session *session, int priority, char const *format, va_list ap);
32
 
 
33
 
#endif /* DRIZZLED_ERRMSG_H */
 
25
#include <vector>
 
26
 
 
27
namespace drizzled
 
28
{
 
29
namespace plugin
 
30
{
 
31
  class ErrorMessage;
 
32
}
 
33
namespace slot
 
34
{
 
35
 
 
36
class ErrorMessage
 
37
{
 
38
private:
 
39
  std::vector<plugin::ErrorMessage *> all_errmsg_handler;
 
40
 
 
41
  bool errmsg_has;
 
42
 
 
43
public:
 
44
  ErrorMessage() : all_errmsg_handler(), errmsg_has(false) {}
 
45
  ~ErrorMessage() {}
 
46
 
 
47
  void add(plugin::ErrorMessage *handler);
 
48
  void remove(plugin::ErrorMessage *handler);
 
49
 
 
50
  bool vprintf(Session *session, int priority, char const *format, va_list ap);
 
51
};
 
52
 
 
53
} /* namespace slot */
 
54
} /* namespace drizzled */
 
55
 
 
56
#endif /* DRIZZLED_SLOT_ERROR_MESSAGE_H */