12 class SubdeviceRegisterAccessor;
13 template<
typename RegisterRawType,
typename WriteDataType>
14 class SubdeviceRegisterWindowAccessor;
76 void close()
override;
83 std::string address, std::map<std::string, std::string> parameters);
93 template<
typename RegisterRawType,
typename WriteDataType>
111 static std::map<BusyRegisterKey, std::shared_ptr<std::mutex>>
_mutexes;
155 size_t wordOffsetInRegister,
bool enforceAlignment);
157 template<
typename UserType>
164 template<
typename UserType>
169 template<
typename UserType>
171 const RegisterPath& registerPathName,
size_t numberOfWords,
size_t wordOffsetInRegister,
174 template<
typename UserType>
176 size_t numberOfWords,
size_t wordOffsetInRegister,
const AccessModeFlags& flags);
190 size_t numberOfWords,
size_t wordOffsetInRegister,
AccessModeFlags flags);
Set of AccessMode flags with additional functionality for an easier handling.
DeviceBackendImpl implements some basic functionality which should be available for all backends.
Catalogue of register information.
Class to store a register path name.
Backend for subdevices which are passed through some register or area of another device (subsequently...
boost::shared_ptr< NDRegisterAccessor< UserType > > getAreaRegisterAccessor(const RegisterPath ®isterPathName, size_t numberOfWords, size_t wordOffsetInRegister, AccessModeFlags flags)
getRegisterAccessor implementation for area types
std::shared_ptr< std::mutex > _mutex
NumericAddressedRegisterCatalogue _registerMap
map from register names to addresses
void open() override
Open the device.
Type _type
type of the subdevice
boost::shared_ptr< NDRegisterAccessor< UserType > > getRegisterWindowAccessor(const RegisterPath ®isterPathName, size_t numberOfWords, size_t wordOffsetInRegister, const AccessModeFlags &flags)
static boost::shared_ptr< DeviceBackend > createInstance(std::string address, std::map< std::string, std::string > parameters)
void close() override
Close the device.
std::string _targetControl
MetadataCatalogue getMetadataCatalogue() const override
Return the device metadata catalogue.
std::pair< DeviceBackend *, RegisterPath > BusyRegisterKey
size_t _addressToDataDelay
for type == registerWindow, threeRegisters or twoRegisters: sleep time between address and data write
boost::shared_ptr< ChimeraTK::DeviceBackend > _targetDevice
The target device backend itself.
DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER(SubdeviceBackend, getRegisterAccessor_impl, 4)
size_t _timeout
timeout (in milliseconds), used in threeRegisters to throw a runtime_error if status register stuck a...
size_t _chipIndex
for type == registerWindow: chip index
void setExceptionImpl() noexcept override
Function to be (optionally) implemented by backends if additional actions are needed when switching t...
boost::shared_ptr< NDRegisterAccessor< UserType > > getSynchronisedRegisterAccessor(const RegisterPath ®isterPathName, size_t numberOfWords, size_t wordOffsetInRegister, const AccessModeFlags &flags)
getRegisterAccessor implementation for threeRegisters types
MetadataCatalogue _metadataCatalogue
void obtainTargetBackend()
obtain the target backend if not yet done
std::map< std::string, std::string > _parameters
currently only used for type == registerWindow: the whole set of parameters
size_t _sleepTime
for type == registerWindow, threeRegisters or twoRegisters: sleep time of polling loop resp.
boost::shared_ptr< NDRegisterAccessor< UserType > > getRegisterAccessor_impl(const RegisterPath ®isterPathName, size_t numberOfWords, size_t wordOffsetInRegister, AccessModeFlags flags)
std::string _targetAlias
the target device name
std::string _targetAddress
for type == registerWindow, threeRegisters or twoRegisters: the names of the basic target registers
std::string _targetArea
for type == area: the name of the target register
void verifyRegisterAccessorSize(const NumericAddressedRegisterInfo &info, size_t &numberOfWords, size_t wordOffsetInRegister, bool enforceAlignment)
Check consistency of the passed sizes and offsets against the information in the map file Will adjust...
std::string readDeviceInfo() override
Return a device information string containing hardware details like the firmware version number or th...
std::string _targetWriteData
static std::mutex _mutexMapMutex
RegisterCatalogue getRegisterCatalogue() const override
Return the register catalogue with detailed information on all registers.
static std::map< BusyRegisterKey, std::shared_ptr< std::mutex > > _mutexes
Mutex to protext concurrent access to the target registers.
void activateAsyncRead() noexcept override
Activate asyncronous read for all transfer elements where AccessMode::wait_for_new_data is set.
std::set< DeviceBackend::BackendID > getInvolvedBackendIDs() override
Get the backend IDs of all involved backends.
boost::shared_ptr< SubdeviceRegisterAccessor > accessorCreationHelper(const NumericAddressedRegisterInfo &info, size_t numberOfWords, size_t wordOffsetInRegister, AccessModeFlags flags)
The RegisterRawType is determined by the number of bytes in the SubDevice mapfile The ReadWriteDataTy...