11#include <unordered_set>
25 void close()
override;
30 std::string address, std::map<std::string, std::string> parameters);
38 template<typename UserType>
40 size_t numberOfWords,
size_t wordOffsetInRegister,
AccessModeFlags flags,
size_t omitPlugins = 0);
42 template<typename UserType>
72 template<
typename UserType>
74 boost::weak_ptr<NDRegisterAccessor<UserType>>
accessor;
82 template<
typename UserType>
Set of AccessMode flags with additional functionality for an easier handling.
Interface for backends to the register catalogue.
The base class for backends providing IO functionality for the Device class.
DeviceBackendImpl implements some basic functionality which should be available for all backends.
RegisterInfo structure for the LogicalNameMappingBackend.
Backend to map logical register names onto real hardware registers.
BackendRegisterCatalogue< LNMBackendRegisterInfo > _catalogue_mutable
We need to make the catalogue mutable, since we fill it within getRegisterCatalogue()
std::set< DeviceBackend::BackendID > getInvolvedBackendIDs() override
Get the backend IDs of all involved backends.
std::unordered_set< std::string > getTargetDevices() const
Obtain list of all target devices referenced in the catalogue.
bool hasParsed
flag if already parsed
static boost::shared_ptr< DeviceBackend > createInstance(std::string address, std::map< std::string, std::string > parameters)
std::pair< DeviceBackend *, RegisterPath > AccessorKey
Map of target accessors which are potentially shared across our accessors.
void parse() const
parse the logical map file, if not yet done
std::map< AccessorKey, SharedAccessor< UserType > > SharedAccessorMap
RegisterCatalogue getRegisterCatalogue() const override
Return the register catalogue with detailed information on all registers.
ChimeraTK::VersionNumber getVersionOnOpen() const
std::map< std::string, boost::shared_ptr< DeviceBackend > > _devices
map of target devices
std::atomic< bool > _asyncReadActive
Flag storing whether asynchronous read has been activated.
boost::shared_ptr< NDRegisterAccessor< UserType > > getRegisterAccessor_internal(const RegisterPath ®isterPathName, size_t numberOfWords, size_t wordOffsetInRegister, AccessModeFlags flags)
void close() override
Close the device.
std::string readDeviceInfo() override
Return a device information string containing hardware details like the firmware version number or th...
boost::shared_ptr< NDRegisterAccessor< UserType > > getRegisterAccessor_impl(const RegisterPath ®isterPathName, size_t numberOfWords, size_t wordOffsetInRegister, AccessModeFlags flags, size_t omitPlugins=0)
friend class LNMBackendRegisterAccessor
void setExceptionImpl() noexcept override
Function to be (optionally) implemented by backends if additional actions are needed when switching t...
void open() override
Open the device.
std::map< std::string, LNMVariable > _variables
Map of variables and constants.
void activateAsyncRead() noexcept override
Activate asyncronous read for all transfer elements where AccessMode::wait_for_new_data is set.
std::mutex sharedAccessorMap_mutex
a mutex to be locked when sharedAccessorMap (the container) is changed
bool catalogueCompleted
Flag whether the catalogue has already been filled with extra information from the target backends.
TemplateUserTypeMap< SharedAccessorMap > sharedAccessorMap
std::map< std::string, std::string > _parameters
map of parameters passed through the CDD
std::string _lmapFileName
name of the logical map file
N-dimensional register accessor.
Catalogue of register information.
Class to store a register path name.
Map of UserType to a class template with the UserType as template argument.
Class for generating and holding version numbers without exposing a numeric representation.
Struct holding shared accessors together with a mutex for thread safety.
boost::weak_ptr< NDRegisterAccessor< UserType > > accessor
std::recursive_mutex mutex