9#include <boost/make_shared.hpp>
28 template<
typename UserType>
35 if(!target->isReadable()) {
37 "LogicalNameMappingBackend ForceReadOnlyPlugin: Cannot target non-readable register.");
41 [[nodiscard]]
bool isWriteable()
const override {
return false; }
54 template<
typename UserType,
typename TargetType>
58 if constexpr(std::is_same<UserType, TargetType>::value) {
59 return boost::make_shared<ForceReadOnlyPluginDecorator<UserType>>(target);
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.
ForceReadOnlyPlugin(const LNMBackendRegisterInfo &info, size_t pluginIndex, const std::map< std::string, std::string > ¶meters)
boost::shared_ptr< NDRegisterAccessor< UserType > > decorateAccessor(boost::shared_ptr< LogicalNameMappingBackend > &backend, boost::shared_ptr< NDRegisterAccessor< TargetType > > &target, const UndecoratedParams &accessorParams)
RegisterInfo structure for the LogicalNameMappingBackend.
bool writeable
Flag if the register is writeable.
Base class for decorators of the NDRegisterAccessor.
N-dimensional register accessor.
std::vector< std::vector< UserType > > buffer_2D
Buffer of converted data elements.
Class for generating and holding version numbers without exposing a numeric representation.
Exception thrown when a logic error has occured.
TransferType
Used to indicate the applicable operation on a Transferelement.
void doPostWrite(TransferType, VersionNumber) override
Backend specific implementation of postWrite().
bool isWriteable() const override
Check if transfer element is writeable.
void doPreWrite(TransferType, VersionNumber) override
Backend specific implementation of preWrite().
ForceReadOnlyPluginDecorator(const boost::shared_ptr< ChimeraTK::NDRegisterAccessor< UserType > > &target)
Helper struct to hold extra parameters needed by some plugins, used in decorateAccessor()