13#ifndef CBMFSDADDRESS_H
14#define CBMFSDADDRESS_H 1
141 int32_t
SetElementId(int32_t address, int32_t level, uint32_t newId);
146 std::string
ToString(int32_t address);
constexpr uint16_t kBits[kCurrentVersion+1][static_cast< uint32_t >(CbmFsdAddress::Level::NumLevels)]
constexpr int32_t kShift[kCurrentVersion+1][static_cast< uint32_t >(CbmFsdAddress::Level::NumLevels)]
constexpr int32_t kMask[kCurrentVersion+1][static_cast< uint32_t >(CbmFsdAddress::Level::NumLevels)]
Functions to encode or decode the address field of FSD data.
uint32_t GetSystemId(int32_t address)
Get system Id (should be integer value of ECbmModuleId::kFsd)
constexpr int32_t kVersionSize
int32_t GetAddress(uint32_t Unit=0, uint32_t Module=0, uint32_t PhotoDet=0, uint32_t Version=kCurrentVersion)
Construct address.
uint32_t GetVersion(int32_t address)
Extract version number.
constexpr int32_t kVersionShift
uint32_t GetElementId(int32_t address, int32_t level)
Get the index of an element.
int32_t SetElementId(int32_t address, int32_t level, uint32_t newId)
Set the index of an element, leaving the other element levels untouched.
int32_t GetMotherAddress(int32_t address, int32_t level)
Construct the address of an element from the address of a descendant element.
constexpr uint32_t kCurrentVersion
constexpr int32_t kVersionMask
std::string ToString(int32_t address)
String output.