15 size_t byteOffset,
size_t numberOfWords)
17 _accAddress(std::move(accAddress)), _accDataArea(std::move(accData)), _accStatus(std::move(accStatus)),
18 _startAddress(byteOffset), _numberOfWords(numberOfWords) {
21 _buffer.resize(numberOfWords);
51 _accAddress->accessData(0) =
static_cast<int32_t
>(adr);
53 usleep(
_backend->addressToDataDelay);
63 for(
size_t innerOffset = 0; innerOffset <
_accDataArea->getNumberOfSamples(); ++innerOffset) {
82 if(++retry > max_retry) {
84 "' failed: timeout waiting for cleared busy flag (" +
_accStatus->getName() +
")");
131 _accStatus->getName() +
"' is not readable.");
173 return {boost::enable_shared_from_this<TransferElement>::shared_from_this()};
N-dimensional register accessor.
boost::shared_ptr< NDRegisterAccessor< int32_t > > _accDataArea
std::vector< int32_t > _buffer
internal buffer
SubdeviceRegisterAccessor(boost::shared_ptr< SubdeviceBackend > backend, const std::string ®isterPathName, boost::shared_ptr< NDRegisterAccessor< int32_t > > accAddress, boost::shared_ptr< NDRegisterAccessor< int32_t > > accDataArea, boost::shared_ptr< NDRegisterAccessor< int32_t > > accStatus, size_t byteOffset, size_t numberOfWords)
bool isReadOnly() const override
Check if transfer element is read only, i.e.
void doReadTransferSynchronously() override
Implementation version of readTransfer() for synchronous reads.
size_t _startAddress
start address and length
void replaceTransferElement(boost::shared_ptr< TransferElement > newElement) override
Search for all underlying TransferElements which are considered identical (see sameRegister()) with t...
void doPostRead(TransferType type, bool hasNewData) override
Backend specific implementation of postRead().
std::list< boost::shared_ptr< TransferElement > > getInternalElements() override
Obtain the full list of TransferElements internally used by this TransferElement.
bool isWriteable() const override
Check if transfer element is writeable.
boost::shared_ptr< SubdeviceBackend > _backend
Pointer to the backend.
boost::shared_ptr< NDRegisterAccessor< int32_t > > _accAddress
Pointers to the three accessors.
bool isReadable() const override
Check if transfer element is readable.
bool doWriteTransfer(ChimeraTK::VersionNumber versionNumber) override
Implementation version of writeTransfer().
void doPreRead(TransferType type) override
Backend specific implementation of preRead().
std::vector< boost::shared_ptr< TransferElement > > getHardwareAccessingElements() override
Obtain the underlying TransferElements with actual hardware access.
bool mayReplaceOther(const boost::shared_ptr< TransferElement const > &) const override
Check whether the TransferElement can be used in places where the TransferElement "other" is currentl...
void doPreWrite(TransferType type, VersionNumber) override
Backend specific implementation of preWrite().
void doPostWrite(TransferType type, VersionNumber) override
Backend specific implementation of postWrite().
boost::shared_ptr< NDRegisterAccessor< int32_t > > _accStatus
void setDataValidity(DataValidity validity=DataValidity::ok)
Set the current DataValidity for this TransferElement.
std::string _name
Identifier uniquely identifying the TransferElement.
DataValidity _dataValidity
The validity of the data in the application buffer.
const std::string & getName() const
Returns the name that identifies the process variable.
boost::shared_ptr< DeviceBackend > _exceptionBackend
The backend to which the runtime_errors are reported via DeviceBackend::setException().
Class for generating and holding version numbers without exposing a numeric representation.
Exception thrown when a logic error has occured.
Exception thrown when a runtime error has occured.
const char * what() const noexcept override
Return the message describing what exactly went wrong.
@ raw
Raw access: disable any possible conversion from the original hardware data type into the given UserT...
TransferType
Used to indicate the applicable operation on a Transferelement.