00001 /* Copyright (C) 2000 KOM/Darmstadt University of Technology 00002 * 00003 * You are allowed to use all other parts of the code under the following terms: 00004 * 00005 * For non-commercial use, code may be used in unmodified form provided 00006 * that this copyright notice and this permission notice appear in 00007 * supporting documentation. 00008 * 00009 * This software is provided "as is" and without any express or implied 00010 * warranties, including, without limitation, the implied warranty of 00011 * fitness for a particular purpose. 00012 * 00013 * The code may be subjected to the GNU General Public License, Version 2, 00014 * and re-distributed under the terms of this license. 00015 * As a special exception, permission is granted to link this code 00016 * with the Qt library and distribute executables, as long as you 00017 * follow the requirements of the GNU GPL in regard to all of the 00018 * software in the executable aside from Qt. 00019 * 00020 * Commercial use other than under the terms of the GNU General Public 00021 * License is allowed only after express negotiation of conditions 00022 * with the authors. 00023 */ 00024 00025 #ifndef MN_SH_REPORT_H 00026 #define MN_SH_REPORT_H 00027 00028 #include <sys/types.h> 00029 00030 #include "mnstream.h" 00031 #include "MNValid.h" 00032 #include "SHRPtr.h" 00033 00034 namespace SH 00035 { 00036 00045 class Report 00046 { 00047 DECLARE_VALID 00048 private: 00049 00050 Report( const Report& ); 00051 Report& operator=( const Report& ); 00052 public: 00053 Report( ); 00054 virtual ~Report(); 00055 00056 void ref(); 00057 void unref(); 00058 00062 typedef const char* const ID; 00063 00069 virtual bool isA( ID id ) const; 00070 00078 static ID Id; 00079 00083 virtual void dump( ostream& ostr ) const; 00084 00085 friend ostream& operator<<( ostream& ostr, const Report& report ); 00086 00087 private: 00088 size_t _ref; 00089 }; 00090 00091 typedef RPtr<Report> ReportPtr; 00092 00093 }; // namespace SH 00094 00095 #endif /* MN_SH_REPORT_H */ 00096