Skip to content
Snippets Groups Projects

Fix dangerous DeVP::sensor interface

Merged Gerhard Raven requested to merge improve-DeVP-sensor into master
  1. Jan 14, 2019
    • Gerhard Raven's avatar
      Fix dangerous DeVP::sensor interface · 80602a62
      Gerhard Raven authored
      * 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`...
      80602a62
Loading