|
From: Kakhkhor A. <kab...@gm...> - 2010-07-12 20:47:41
|
>> 1. generalstatistics.hpp >> In reset() method use "the swap trick" to reset the vector of >> samples. The assignment >> of an empty vector doesn't free the storage. (Item 17 in >> "Effective STL"). >I'm not sure about that. It's likely that after a reset(), we'll start >adding new samples, in which case the storage will save us an >allocation. Agree. The storage can be reused later. In that case, we could simply use vector's clear method instead of assigning an empty vector. >We should define P though. Do you care to give it a try? I would, but never used doxygen before. >> 5. instrument.hpp >> "virtual" can be omitted from the declaration of 'performCalculations'. >No, that's intentional. We wanted to leave it virtual so that one can >override the engine mechanism if needed. It is not a bug, but more like pedantic adherence to the coding style. performCalculations is declared virtual in LazyObject. We could drop the keyword virtual when overwriting performCalculations in Instrument, just like we drop the keyword virtual when overwriting all other virtual methods in derived classes. Regards, Kakhkhor Abdijalilov. |