7#include <boost/make_shared.hpp>
14 const LNMBackendRegisterInfo& info,
size_t pluginIndex,
const std::map<std::string, std::string>& parameters)
16 auto unitIt = parameters.find(
"engineeringUnit");
17 if(unitIt != parameters.end()) {
18 _engineeringUnit = unitIt->second;
20 auto descriptionIt = parameters.find(
"description");
21 if(descriptionIt != parameters.end()) {
22 _description = descriptionIt->second;
31 if(_engineeringUnit) {
41 template<
typename UserType,
typename TargetType>
45 if constexpr(std::is_same<UserType, TargetType>::value) {
46 if(_engineeringUnit) {
47 target->setUnit(*_engineeringUnit);
50 target->setDescription(*_description);
LNMBackendRegisterInfo _info
RegisterInfo describing the the target register for which this plugin instance should work.
Base class for plugins that modify the behaviour of accessors in the logical name mapping backend.
void doRegisterInfoUpdate() override
Implementation of the plugin specific register information update.
boost::shared_ptr< NDRegisterAccessor< UserType > > decorateAccessor(boost::shared_ptr< LogicalNameMappingBackend > &backend, boost::shared_ptr< NDRegisterAccessor< TargetType > > &target, const UndecoratedParams &accessorParams)
SetDescriptionPlugin(const LNMBackendRegisterInfo &info, size_t pluginIndex, const std::map< std::string, std::string > ¶meters)
RegisterInfo structure for the LogicalNameMappingBackend.
std::string description
Custom description overwritten by plugins (e.g.
std::string engineeringUnit
Custom engineering unit overwritten by plugins (e.g.
N-dimensional register accessor.
Helper struct to hold extra parameters needed by some plugins, used in decorateAccessor()