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_origin_filter_hh___included 00029 #define lestes__msg___report_origin_filter_hh___included 00030 00031 /*! \file 00032 \brief Report origin filter. 00033 00034 Declaration of report_origin_filter class representing filter of report origin. 00035 \author pt 00036 */ 00037 #include <lestes/common.hh> 00038 #include <lestes/msg/report_filter.hh> 00039 00040 package(lestes); 00041 package(std); 00042 // forward declaration to avoid cycle 00043 class source_location; 00044 class file_info; 00045 end_package(std); 00046 package(msg); 00047 00048 // forward declaration to avoid cycle 00049 class message; 00050 00051 /*! 00052 \brief Report output. 00053 00054 Writes reports to a supplied stream. 00055 */ 00056 class report_origin_filter : public report_filter { 00057 public: 00058 //! Filters the origin. 00059 virtual void process(const ptr<message> &a_message, 00060 const ptr<source_location> &a_location); 00061 //! Returns new instance. 00062 static ptr<report_origin_filter> create(const ptr<report_filter> &a_output); 00063 protected: 00064 //! Creates the object. 00065 report_origin_filter(const ptr<report_filter> &a_output); 00066 //! Marks the object. 00067 virtual void gc_mark(void); 00068 private: 00069 //! Origin of the last report location's file. 00070 srp<source_location> last_origin; 00071 //! New file information with removed origin. 00072 srp<file_info> new_file; 00073 //! Hides copy constructor. 00074 report_origin_filter(const report_origin_filter &); 00075 //! Hides assignment operator. 00076 report_origin_filter &operator=(const report_origin_filter &); 00077 }; 00078 00079 end_package(msg); 00080 end_package(lestes); 00081 #endif 00082 /* vim: set ft=lestes : */
1.5.1-20070107