Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages   Examples  

HtmlReport Class Reference
[Base]

Inherits Report.


Detailed Description

HTML report.

Author:
Ralf Gerstenberger

HtmlReport gathers information from report generating model components and generates a html output. This output is written to a file or an output stream.

Example:
At first the user has to create an instance of HtmlReport in order to use it. A good place to do this is the initSimulation() function of a simulation class.
class UserSimulation : public Simulation {
...
public:
HtmlReport* myReport;
Waitq* myWaitq;
Accum* myStatistics;
Uniform* myRandom;
...
virtual void initSimulation {
        myReport = new HtmlReport(this, "MyReport.html");
        myWaitq = new ...
HtmlReport gathers information only from registered model components. To add a model component to an instance of HtmlReport use addProducer(). You can remove a registered object with removeProducer(). Only objects which support Report (as noted in documentation) can be added to a HtmlReport.
        myReport.addProducer(myWaitq);
        myReport.addProducer(myStatistics);
        myReport.addProducer(myRandom);
...     
}
...
The generation of a report is triggered with generateReport().
int main()
{
        UserSimulation mySim;
        mySim.run();
        mySim.myReport->generateReport();
}
You can have several reports in a single simulation, which gather information from different components. The content of the report does not depend on the time when a model component is added to a report but only on the model component itself and on the time when the generation is triggered. Most of the model components that support report are statistical objects which have a function called reset(). Such a reset can be done for every object individually or for all objects at the simulation object.
int main()
{
        UserSimulation mySim;
        mySim.runUntil(10.0);
        mySim.reset();
        mySim.runUntil(40.0);
        mySim.myStatistics->reset();
        mySim.run();

        HtmlReport mySecondReport(&mySim, "My2Report.html");
        mySecondReport.addProducer(myRandom);

        mySim.myReport->generateReport();
        mySecondReport.generateReport();
}
Since:
1.0


Public Member Functions

Construction
 HtmlReport (Simulation *s, const char *filename=0)
 HtmlReport (Simulation *s, std::ostream &os)
Destruction
virtual ~HtmlReport ()

Protected Member Functions

virtual void processTables ()
 processTables implementation


Constructor & Destructor Documentation

HtmlReport Simulation s,
const char *  filename = 0
 

Parameters:
s pointer to the Simulation object
filename filename of output file
HtmlReport opens the file filename and writes into this file. When HtmlReport is deleted the file is closed. If HtmlReport fails to open the file the output is send to stdout.

HtmlReport Simulation s,
std::ostream &  os
 

Parameters:
s pointer to the Simulation object
os ostream for output
HtmlReport writes to the output stream os.

~HtmlReport  )  [virtual]
 

In case HtmlReport has opened a file it is closed by the destructor.


Member Function Documentation

void processTables  )  [protected, virtual]
 

processTables implementation

HtmlReport is derived from the Report class. Report implements management of report producer and data transfer. The data are provided by registered report producer and transferred as tables. HtmlReport implements the processTables() function to generate html output from this tables.

Implements Report.


Generated on Mon Aug 11 10:36:06 2003 for ODEMx by doxygen1.3