Drizzled Public API Documentation

error_message.h
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Definitions required for Error Message plugin
00005  *
00006  *  Copyright (C) 2008 Sun Microsystems, Inc.
00007  *
00008  *  This program is free software; you can redistribute it and/or modify
00009  *  it under the terms of the GNU General Public License as published by
00010  *  the Free Software Foundation; version 2 of the License.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020  */
00021 
00022 #pragma once
00023 
00024 #include <drizzled/plugin/plugin.h>
00025 #include <drizzled/error/priority_t.h>
00026 
00027 #include <stdarg.h>
00028 
00029 #include <string>
00030 
00031 #include <drizzled/visibility.h>
00032 
00033 namespace drizzled
00034 {
00035 
00036 namespace plugin
00037 {
00038 
00039 class DRIZZLED_API ErrorMessage : public Plugin
00040 {
00041 public:
00042   explicit ErrorMessage(std::string name_arg)
00043    : Plugin(name_arg, "ErrorMessage")
00044   {}
00045 
00046   virtual bool errmsg(error::priority_t priority, const char *format, va_list ap)=0;
00047 
00048   static bool addPlugin(plugin::ErrorMessage *handler);
00049   static void removePlugin(plugin::ErrorMessage *handler);
00050 
00051   static bool vprintf(error::priority_t priority, char const *format, va_list ap);
00052 
00053   bool removeLast() const
00054   {
00055     return true;
00056   }
00057 };
00058 
00059 } /* namespace plugin */
00060 } /* namespace drizzled */
00061