report_ostream.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___report_ostream_hh___included
00029 #define lestes__msg___report_ostream_hh___included
00030 
00031 /*! \file
00032   \brief Report stream output.
00033 
00034   Declaration of report_ostream class representing report output to stream.
00035   \author pt
00036 */
00037 #include <lestes/common.hh>
00038 #include <lestes/std/ostream_wrapper.hh>
00039 #include <lestes/msg/report_filter.hh>
00040 
00041 package(lestes);
00042 package(std);
00043 // forward declaration to avoid cycle
00044 class source_location;
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_ostream : public report_filter {
00057 public:
00058         //! Writes report to stream.
00059         virtual void process(const ptr<message> &a_message,
00060                         const ptr<source_location> &a_location);
00061         //! Returns new instance.
00062         static ptr<report_ostream> create(const ptr<report_filter> &a_output, const ptr<ostream_wrapper> &a_stream);
00063 protected:
00064         //! Creates the object.
00065         report_ostream(const ptr<report_filter> &a_output, const ptr<ostream_wrapper> &a_stream);
00066         //! Marks the object.
00067         virtual void gc_mark(void);
00068 private:
00069         //! Output stream.
00070         srp<ostream_wrapper> stream;
00071         //! Hides copy constructor.
00072         report_ostream(const report_ostream &);
00073         //! Hides assignment operator.
00074         report_ostream &operator=(const report_ostream &);
00075 };
00076 
00077 end_package(msg);
00078 end_package(lestes);
00079 #endif
00080 /* vim: set ft=lestes : */

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