reporter.hh

Go to the documentation of this file.
00001 /*
00002    The lestes compiler suite
00003    Copyright (C) 2002, 2003, 2004, 2005 Miroslav Tichy
00004    Copyright (C) 2002, 2003, 2004, 2005 Petr Zika
00005    Copyright (C) 2002, 2003, 2004, 2005 Vojtech Hala
00006    Copyright (C) 2002, 2003, 2004, 2005 Jiri Kosina
00007    Copyright (C) 2002, 2003, 2004, 2005 Pavel Sanda
00008    Copyright (C) 2002, 2003, 2004, 2005 Jan Zouhar
00009    Copyright (C) 2002, 2003, 2004, 2005 Rudolf Thomas
00010 
00011    This program is free software; you can redistribute it and/or modify
00012    it under the terms of the GNU General Public License as published by
00013    the Free Software Foundation; version 2 of the License.
00014 
00015    This program is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018    GNU General Public License for more details.
00019 
00020    See the full text of the GNU General Public License version 2, and
00021    the limitations in the file doc/LICENSE.
00022 
00023    By accepting the license the licensee waives any and all claims
00024    against the copyright holder(s) related in whole or in part to the
00025    work, its use, and/or the inability to use it.
00026  
00027  */
00028 #ifndef lestes__msg___reporter_hh___included
00029 #define lestes__msg___reporter_hh___included
00030 
00031 /*! \file
00032   \brief Message reporter.
00033 
00034   Declaration of reporter class representing message reporter.
00035   \author pt
00036 */
00037 #include <lestes/common.hh>
00038 
00039 package(lestes);
00040 
00041 package(std);
00042 // forward declaration to avoid cycle
00043 class source_location;
00044 end_package(std);
00045 
00046 package(msg);
00047 
00048 // forward declaration to avoid cycle
00049 class message;
00050 class report_filter;
00051 
00052 /*!
00053   \brief Message reporter.
00054 
00055   Represents singleton reporter of messages with location.
00056   The behaviour is altered by setting the filter to process the messages.
00057 */
00058 class reporter: public ::lestes::std::object {
00059 public:
00060         //! Reports message at location.
00061         void report(const ptr<message> &a_message,
00062                         const ptr<source_location> &a_location);
00063         //! Sets active filter.
00064         void filter_set(const ptr<report_filter> &a_filter);
00065         //! Returns active filter.
00066         ptr<report_filter> filter_get(void) const;
00067         //! Returns the reporter.
00068         static ptr<reporter> instance(void);
00069 private:
00070         //! Creates the reporter.
00071         reporter(void);
00072 protected:
00073         //! Filter used for reporting.
00074         srp<report_filter> filter;
00075         //! Hides copy constructor.
00076         reporter(const reporter &);
00077         //! Hides assignment operator.
00078         reporter &operator=(const reporter &);
00079         //! The only instance.
00080         static ptr<reporter> singleton;
00081 };
00082 
00083 end_package(msg);
00084 
00085 // TODO
00086 extern ptr< ::lestes::msg::reporter > report;
00087 
00088 end_package(lestes);
00089 #endif
00090 /* vim: set ft=lestes : */

Generated on Mon Feb 12 18:23:11 2007 for lestes by doxygen 1.5.1-20070107