Development #1353: Code cleanup for OCT19
Code cleanup: trd/base/CbmTrdParSetAsic.h
Cbmroot/trunk/source/trd/base/CbmTrdParSetAsic.h:27:17: warning: 'CbmTrdParSetAsic::addParam' hides overloaded virtual function [-Woverloaded-virtual] void addParam(CbmTrdParSetAsic*); ^ Cbmroot/trunk/source/trd/base/CbmTrdParSet.h:30:25: note: hidden overloaded virtual function 'CbmTrdParSet::addParam' declared here: type mismatch at 1st parameter ('CbmTrdParMod *' vs 'CbmTrdParSetAsic *') virtual void addParam(CbmTrdParMod *mod); ^ 1 warning generated.
Please fix (adjust argument type or rename method in derived class).
Updated by Volker Friese almost 3 years ago
- Status changed from Assigned to Resolved
- % Done changed from 0 to 90
Closer inspection of the code shows that CbmTrdParSetAsic implements a different functionality in addParams() than the other ParSets (CbmTrdParSetGas, CbmTrdParSetDigi, CbmTrdParSetGain). Those three do not re-implement addParams() as inherited from CbmTrdParSet. Also, the treatment in CbmTrdParManager::CreateModuleParameters(), where the parameter containers are filled, is different for CbmTrdParSetAsic. This is probably because there are several ASICs connected to one module. While there are corresponding classes CbmTrdParModGain, CbmTrParModGas, CbmTrdParModDigi for the three other parameter sets, a class CbmTrdParModAsic does not exist.
The re-declaration of addParams() in CbmTrdParSetAsic with a different argument type is legal, but misleading. The compiler warning is thus in place.
As a measure, I have renamed with r15040 CbmTrdParSetAsic::addParams(CbmTrdParSetAsic*) to CbmTrdParSetAsic::AddParameters(CbmParSetAsic*). The only location from where this is called is line 227 of CbmTrdParManager (in method CreateModuleParameters()). I have changed the call accordingly.