12#ifndef O2_DATAFORMATS_MCH_DS_CHANNEL_ID_H_
13#define O2_DATAFORMATS_MCH_DS_CHANNEL_ID_H_
30 DsChannelId(uint16_t solarId, uint8_t eLinkId, uint8_t channel)
32 set(solarId, eLinkId, channel);
35 static uint32_t
make(uint16_t solarId, uint8_t eLinkId, uint8_t channel)
37 uint32_t
id = (
static_cast<uint32_t
>(solarId) << 16) +
38 (
static_cast<uint32_t
>(eLinkId) << 8) + channel;
42 void set(uint16_t solarId, uint8_t eLinkId, uint8_t channel)
47 uint16_t
getSolarId()
const {
return static_cast<uint16_t
>((mChannelId >> 16) & 0xFFFF); }
48 uint8_t
getElinkId()
const {
return static_cast<uint8_t
>((mChannelId >> 8) & 0xFF); }
50 [[deprecated(
"use getElinkId instead which better reflects what it is and avoid confusion with dsId from DsDetId")]] uint8_t
getDsId()
const {
return getElinkId(); }
51 uint8_t
getChannel()
const {
return static_cast<uint8_t
>(mChannelId & 0xFF); }
55 uint32_t
value()
const {
return mChannelId; }
57 bool isValid()
const {
return (mChannelId != 0); }
60 uint32_t mChannelId{0};
std::string asString() const
DsChannelId(uint16_t solarId, uint8_t eLinkId, uint8_t channel)
DsChannelId(uint32_t channelId)
uint8_t getElinkId() const
static uint32_t make(uint16_t solarId, uint8_t eLinkId, uint8_t channel)
void set(uint16_t solarId, uint8_t eLinkId, uint8_t channel)
uint16_t getSolarId() const
uint8_t getChannel() const
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
bool operator==(const DsChannelId &a, const DsChannelId &b)
bool operator>=(const DsChannelId &a, const DsChannelId &b)
bool operator>(const DsChannelId &a, const DsChannelId &b)
bool operator<(const DsChannelId &a, const DsChannelId &b)
bool operator!=(const DsChannelId &a, const DsChannelId &b)
bool operator<=(const DsChannelId &a, const DsChannelId &b)