10 template<
typename UserType>
12 _accessorManager->unsubscribe(this->getId());
15 template<
typename UserType>
17 boost::shared_ptr<AsyncAccessorManager> manager, boost::shared_ptr<Domain> asyncDomain, std::string
const& name,
18 size_t nChannels,
size_t nElements,
AccessModeFlags accessModeFlags, std::string
const& unit,
19 std::string
const& description)
21 :
NDRegisterAccessor<UserType>(name, accessModeFlags, unit, description), _backend(std::move(backend)),
22 _accessorManager(std::move(manager)), _asyncDomain(std::move(asyncDomain)), _receiveBuffer(nChannels, nElements) {
28 for(
auto& chan :
buffer_2D) chan.resize(nElements);
34 for(
size_t i = 0; i < _queueSize + 1; ++i) {
35 Buffer b1(nChannels, nElements);
37 Buffer b2(nChannels, nElements);
42 [&](Buffer& buf) { std::swap(
_receiveBuffer, buf); }, std::launch::deferred);
46 template<
typename UserType>
48 if(updateDataBuffer) {
51 this->_versionNumber = _receiveBuffer.versionNumber;
52 this->_dataValidity = _receiveBuffer.dataValidity;
55 auto source = _receiveBuffer.value.begin();
56 auto destination = this->buffer_2D.begin();
57 for(; source != _receiveBuffer.value.end(); ++source, ++destination) {
58 destination->swap(*source);
64 template<
typename UserType>
66 if(_asyncDomain->unsafeGetIsActive()) {
67 _dataTransportQueue.push_overwrite(std::move(data));