Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

reporter.cc

Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 2000 Alan McIvor <alan@mcivor.gen.nz>
00003 **  
00004 ** This program is free software; you can redistribute it and/or modify
00005 ** it under the terms of the GNU General Public License as published by
00006 ** the Free Software Foundation; either version 2 of the License, or
00007 ** (at your option) any later version.
00008 ** 
00009 ** This program is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 ** GNU General Public License for more details.
00013 ** 
00014 ** You should have received a copy of the GNU General Public License
00015 ** along with this program; if not, write to the Free Software 
00016 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 */
00018 #include <stdarg.h>
00019 
00020 #ifdef HAVE_CONFIG_H
00021 #include <config.h>
00022 #endif
00023 
00024 using namespace std;
00025 
00026 #include "messenger.h"
00027 #include "reporter.h"
00028 
00029 Reporter::Reporter()
00030 {
00031 
00032 #ifdef VARIABLE
00033 #  undef VARIABLE
00034 #endif
00035 
00036 # define VARIABLE(AA,BB,CC) BB = CC;
00037 
00038 #include "reporter.i"
00039 
00040     monthNames[0] = "Jan";
00041     monthNames[1] = "Feb";
00042     monthNames[2] = "Mar";
00043     monthNames[3] = "Apr";
00044     monthNames[4] = "May";
00045     monthNames[5] = "Jun";
00046     monthNames[6] = "Jul";
00047     monthNames[7] = "Aug";
00048     monthNames[8] = "Sep";
00049     monthNames[9] = "Oct";
00050     monthNames[10] = "Nov";
00051     monthNames[11] = "Dec";
00052 
00053 };
00054 
00055 
00056 void Reporter::Debug(char *fmt, ...) 
00057 {
00058     va_list args;
00059 
00060     va_start(args, fmt);
00061     MESSENGER::Debug(MESSENGER::REPORTER, fmt, args);
00062     va_end(args);
00063 }
00064 
00065 void Reporter::Error(char *fmt, ...) 
00066 {
00067     char buf[1024];
00068     va_list args;
00069 
00070     va_start(args, fmt);
00071     vsprintf(buf, fmt, args);
00072     va_end(args);
00073     
00074     throw ReporterException( buf );
00075 }
00076 
00077 void Reporter::Warning(char *fmt, ...) 
00078 {
00079     va_list args;
00080 
00081     va_start(args, fmt);
00082     MESSENGER::Warning(fmt, args);
00083     va_end(args);
00084 }
00085 
00086 void Reporter::DoReports( Project *project )
00087 {
00088     SlippageReport(project);
00089 
00090     if ( text_report != NULL )
00091         TextReport(project, text_report);
00092 
00093     if ( xml_report != NULL )
00094         XMLReport(project, xml_report);
00095 
00096     if ( weekly_tex_report != NULL )
00097         WeeklyReport(project, weekly_tex_report, TEX_REPORT);
00098 
00099     if ( monthly_tex_report != NULL )
00100         MonthlyReport(project, monthly_tex_report, TEX_REPORT);
00101 
00102     if ( weekly_html_report != NULL )
00103         WeeklyReport(project, weekly_html_report, HTML_REPORT);
00104     if ( monthly_html_report != NULL )
00105         MonthlyReport(project, monthly_html_report, HTML_REPORT);
00106 
00107     if ( weekly_txt_report != NULL )
00108         WeeklyReport(project, weekly_txt_report, TXT_REPORT);
00109     if ( monthly_txt_report != NULL )
00110         MonthlyReport(project, monthly_txt_report, TXT_REPORT);
00111 
00112     if ( tex_report != NULL )
00113         TexReport(project, tex_report);
00114 
00115     if ( html_report != NULL )
00116         HTMLReport(project, html_report);
00117 
00118     if ( hard_schedule != NULL )
00119         HardSchedule(project, hard_schedule);
00120 
00121     if ( util_graph != NULL )
00122         UtilGraph(project, util_graph);
00123 
00124     for ( vector<TASKGRAPH *>::const_iterator tg = mTaskGraphs.begin() ; 
00125           tg != mTaskGraphs.end() ; tg++ )
00126         TaskGraph(project, (*tg)->start, (*tg)->finish, (*tg)->filename.c_str());
00127 
00128     for ( vector<TASKNET *>::const_iterator pc = mTaskNets.begin() ; 
00129           pc != mTaskNets.end() ; pc++ )
00130         NetworkDiagram(project, (*pc)->start, (*pc)->finish, (*pc)->filename.c_str());
00131 
00132     if ( html_cost_report != NULL )
00133         CostReport(project, html_cost_report, HTML_REPORT);
00134 
00135     if ( tex_cost_report != NULL )
00136         CostReport(project, tex_cost_report, TEX_REPORT);
00137     
00138 }
00139 
00140 ReporterException::ReporterException(string reason)
00141     : OpenschedException(reason)
00142 {
00143 }
00144 
00145 ReporterException::~ReporterException()
00146 {
00147 }

Generated on Wed Feb 18 22:23:54 2004 for Opensched by doxygen1.2.15