class CarDecoratorLogger public CarDecorator virtual float getCost flo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
class CarDecoratorLogger : public CarDecorator
{
...
virtual float getCost()
{
float retValue = CarDecorator::getCost();
LOG_TO_FILE("getCost for %s returned %d", mCar->getDescription(), retValue);
return retValue;
}
virtual void addEngine(Engine* engine)
{
LOG_TO_FILE("addEngine(%s) for %s", engine->getDescription(), mCar->getDescription());
CarDecorator::addEngine(engine);
}
...
};