I have been involved with generating the report cards for participants of a competition. The report card will contain the candidate’s details as well as graphs that gives them a sense of how well they did in their venue, in their category, or among those who play the same instrument.
First I parse through a spreadsheet that contains the candidates’ details, such as his/her score or piece performed. For this first parse, I collected the data sets of candidates’ marks of all venues, instruments and categories. I then converted the marks into percentiles.
I run another parse through the spreadsheet,this time to generate the PDFs, filling each PDF with candidate’s details and graphs generated with the data sets gotten from the first parse. However I had to ensure that the first parse fell out of scope to call the destructor if I want to parse again, as Dr Shawn has pointed out. Thus I place the first parse in a subroutine, and call it from the main function, before proceeding with the second parse.
When generating the PDFs it too involved calling the class’s destructors. It would be a problem if the PDF files do not get deleted after they are generated. Thus I used the Poco::TemporaryFile class to generate temporary files of the PDFs, which will get deleted when the class destructor is called.