Skip to content

Fix dangerous DeVP::sensor interface

Gerhard Raven requested to merge improve-DeVP-sensor into master
  • deprecate sensorOfChannel(const LHCb::VPChannelID channel)
  • add sensor(LHCb::VPChannelID channel) const

The reason for this change is that there is already sensor(unsigned int sensorNumber) const, and because there is an implicitly defined conversion from VPChannelID to unsigned int, one can invoke sensor already with a VPChannelID, which will result in an out-of-bounds access. To avoid this, the overload of sensor for VPChannelID is added, at which point there is no use anymore for sensorOfChannel...

Edited by Marco Cattaneo

Merge request reports

Loading