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___report_filter_hh___included 00029 #define lestes__msg___report_filter_hh___included 00030 00031 /*! \file 00032 \brief Report filter. 00033 00034 Declaration of report_filter class representing report filter. 00035 \author pt 00036 */ 00037 #include <lestes/common.hh> 00038 00039 package(lestes); 00040 package(std); 00041 // forward declaration to avoid cycle 00042 class source_location; 00043 end_package(std); 00044 package(msg); 00045 00046 // forward declaration to avoid cycle 00047 class message; 00048 00049 /*! 00050 \brief Report filter. 00051 00052 Represents abstract filter of reported messages with location. 00053 Each inherited filter is intended to either perform an optional transformation 00054 on a report and call process_output(), or filter it out by not calling process_output(). 00055 Individual filters' create methods should reserve first parameter to specifying output, 00056 followed by other specific parameters, to enable easy chaining of filters. 00057 */ 00058 class report_filter : public ::lestes::std::object { 00059 public: 00060 //! Processes a report. 00061 virtual void process(const ptr<message> &a_message, 00062 const ptr<source_location> &a_location) abstract; 00063 //! Returns output. 00064 ptr<report_filter> output_get(void) const; 00065 protected: 00066 //! Creates a filter with no output. 00067 report_filter(void); 00068 //! Creates a filter with output. 00069 report_filter(const ptr<report_filter> &a_output); 00070 //! Processes a report by output. 00071 void process_output(const ptr<message> &a_message, 00072 const ptr<source_location> &a_location); 00073 private: 00074 //! The output to pass reports to. 00075 srp<report_filter> output; 00076 //! Hides copy constructor. 00077 report_filter(const report_filter &); 00078 //! Hides assignment operator. 00079 report_filter &operator=(const report_filter &); 00080 }; 00081 00082 end_package(msg); 00083 end_package(lestes); 00084 #endif 00085 /* vim: set ft=lestes : */
1.5.1-20070107