16 template<
typename UserType>
20 size_t numberOfWords,
size_t wordOffsetInRegister,
AccessModeFlags flags)
26 _dev = boost::dynamic_pointer_cast<LogicalNameMappingBackend>(dev);
32 assert(
_info.
targetType == LNMBackendRegisterInfo::TargetType::CHANNEL);
36 boost::shared_ptr<DeviceBackend> targetDevice;
37 if(devName !=
"this") {
38 targetDevice =
_dev->_devices[devName];
43 _accessor = targetDevice->getRegisterAccessor<UserType>(
50 " exceeds number of channels of target register,"
51 " in accesor for register '" +
52 registerPathName +
"'.");
73 "name mapping devices is not supported.");
80 if(!hasNewData)
return;
82 this->_versionNumber =
_accessor->getVersionNumber();
83 this->_dataValidity =
_accessor->dataValidity();
86 [[nodiscard]]
bool mayReplaceOther(
const boost::shared_ptr<TransferElement const>& other)
const override {
87 auto rhsCasted = boost::dynamic_pointer_cast<const LNMBackendChannelAccessor<UserType>>(other);
88 if(!rhsCasted)
return false;
90 if(
_dev != rhsCasted->_dev)
return false;
94 [[nodiscard]]
bool isReadOnly()
const override {
return true; }
96 [[nodiscard]]
bool isReadable()
const override {
return true; }
98 [[nodiscard]]
bool isWriteable()
const override {
return false; }
101 this->_exceptionBackend = exceptionBackend;
102 _accessor->setExceptionBackend(exceptionBackend);
109 boost::shared_ptr<NDRegisterAccessor<UserType>>
_accessor;
115 boost::shared_ptr<LogicalNameMappingBackend>
_dev;
121 return _accessor->getHardwareAccessingElements();
125 auto result =
_accessor->getInternalElements();
131 auto casted = boost::dynamic_pointer_cast<NDRegisterAccessor<UserType>>(newElement);
132 if(casted &&
_accessor->mayReplaceOther(newElement)) {
136 _accessor->replaceTransferElement(newElement);
138 _accessor->setExceptionBackend(this->_exceptionBackend);