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_kind_filter_hh___included 00029 #define lestes__msg___report_kind_filter_hh___included 00030 00031 /*! \file 00032 \brief Report kind filter. 00033 00034 Declaration of report_kind_filter class representing report kind filter. 00035 \author pt 00036 */ 00037 #include <lestes/common.hh> 00038 #include <lestes/std/vector.hh> 00039 #include <lestes/std/set.hh> 00040 #include <lestes/msg/report_filter.hh> 00041 00042 package(lestes); 00043 package(std); 00044 // forward declaration to avoid cycle 00045 class source_location; 00046 end_package(std); 00047 package(msg); 00048 00049 // forward declaration to avoid cycle 00050 class message; 00051 class message_stencil; 00052 00053 /*! 00054 \brief Report kind filter. 00055 00056 Filters out certain kinds of reports. Used to switch off specific messages. 00057 */ 00058 class report_kind_filter : public report_filter { 00059 public: 00060 //! Type of message stencils list. 00061 typedef ::lestes::std::vector< srp<message_stencil> > stencils_type; 00062 //! Filters out reports by kind. 00063 virtual void process(const ptr<message> &a_message, 00064 const ptr<source_location> &a_location); 00065 //! Returns new instance. 00066 static ptr<report_kind_filter> create(const ptr<report_filter> &a_output, const ptr<stencils_type> &a_stencils); 00067 protected: 00068 //! Creates the object. 00069 report_kind_filter(const ptr<report_filter> &a_output, const ptr<stencils_type> &a_stencils); 00070 private: 00071 //! Type of disabled messages. 00072 // TODO pt change for bit vector 00073 typedef ::lestes::std::set<ulint> disabled_type; 00074 //! Disabled messages. 00075 srp<disabled_type> disabled; 00076 //! Hides copy constructor. 00077 report_kind_filter(const report_kind_filter &); 00078 //! Hides assignment operator. 00079 report_kind_filter &operator=(const report_kind_filter &); 00080 }; 00081 00082 end_package(msg); 00083 end_package(lestes); 00084 #endif 00085 /* vim: set ft=lestes : */
1.5.1-20070107