|
ChimeraTK-DeviceAccess
03.18.00
|
Go to the documentation of this file.
5 #include "../TransferGroup.h"
25 template<
typename UserType>
30 boost::shared_ptr<SubDomain<std::nullptr_t>>
_parent;
37 template<
typename UserType>
58 template<
typename UserType>
61 auto synchronousFlags = descriptor.
flags;
64 auto syncAccessor =
_backend->getRegisterAccessor<UserType>(
77 return std::make_unique<PolledAsyncVariable<UserType>>(syncAccessor,
_version);
81 template<
typename UserType>
83 this->_sendBuffer.versionNumber = _version;
84 this->_sendBuffer.dataValidity = syncAccessor->dataValidity();
85 this->_sendBuffer.value.swap(syncAccessor->accessChannels());
89 template<
typename UserType>
92 :
AsyncVariableImpl<UserType>(syncAccessor_->getNumberOfChannels(), syncAccessor_->getNumberOfSamples()),
93 syncAccessor(syncAccessor_), _version(v) {}
TriggeredPollDistributor(boost::shared_ptr< DeviceBackend > backend, boost::shared_ptr< SubDomain< std::nullptr_t >> parent, boost::shared_ptr< Domain > asyncDomain)
void addAccessor(TransferElementAbstractor &accessor)
Add a register accessor to the group.
TransferGroup _transferGroup
Send backend-specific asynchronous data to different distributors:
void remove(AccessMode flag)
Remove the given flag from the set.
unsigned int getNumberOfChannels() override
Helper functions for the creation of an AsyncNDRegisterAccessor.
size_t wordOffsetInRegister
AsyncVariableImpl contains a weak pointer to an AsyncNDRegisterAccessor<UserType> and a send buffer N...
Exception thrown when a runtime error has occured.
Group multiple data accessors to efficiently trigger data transfers on the whole group.
The TriggeredPollDistributor has std::nullptr_t source data type and is polling the data for the Asyn...
Helper class to have a complete descriton to create an Accessor.
void fillSendBuffer() final
Fill the send buffer with data and version number.
@ wait_for_new_data
Make any read blocking until new data has arrived since the last read.
Implementation of the PolledAsyncVariable for the concrete UserType.
boost::shared_ptr< DeviceBackend > _backend
boost::shared_ptr< Domain > _asyncDomain
boost::shared_ptr< SubDomain< std::nullptr_t > > _parent
PolledAsyncVariable(boost::shared_ptr< NDRegisterAccessor< UserType >> syncAccessor_, VersionNumber &v)
The constructor takes an already created synchronous accessor and a reference to the version variable...
std::unique_ptr< AsyncVariable > createAsyncVariable(AccessorInstanceDescriptor const &descriptor)
Class for generating and holding version numbers without exposing a numeric representation.
const std::string & getUnit() override
const std::string & getDescription() override
bool prepareIntermediateBuffers() override
Poll all sync variables.
unsigned int getNumberOfSamples() override
N-dimensional register accessor.
boost::shared_ptr< NDRegisterAccessor< UserType > > syncAccessor