HtmlReport gathers information from report generating model components and generates a html output. This output is written to a file or an output stream.
class UserSimulation : public Simulation { ... public: HtmlReport* myReport; Waitq* myWaitq; Accum* myStatistics; Uniform* myRandom; ... virtual void initSimulation { myReport = new HtmlReport(this, "MyReport.html"); myWaitq = new ...
myReport.addProducer(myWaitq); myReport.addProducer(myStatistics); myReport.addProducer(myRandom); ... } ...
int main()
{
UserSimulation mySim;
mySim.run();
mySim.myReport->generateReport();
}
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(); }
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 |
|
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 . |
|
os . |
|
In case HtmlReport has opened a file it is closed by the destructor. |
|
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. |