ChimeraTK-DeviceAccess
03.18.00
|
AsyncVariableImpl contains a weak pointer to an AsyncNDRegisterAccessor<UserType> and a send buffer NDRegisterAccessor<UserType>::Buffer. More...
#include <AsyncAccessorManager.h>
Public Member Functions | |
AsyncVariableImpl (size_t nChannels, size_t nElements) | |
void | send () final |
Send the value from the _sendBuffer of the AsyncVariableImpl. More... | |
void | sendException (std::exception_ptr e) final |
Send an exception to all subscribers. More... | |
unsigned int | getNumberOfChannels () override |
Helper functions for the creation of an AsyncNDRegisterAccessor. More... | |
unsigned int | getNumberOfSamples () override |
Public Member Functions inherited from ChimeraTK::async::AsyncVariable | |
virtual | ~AsyncVariable ()=default |
virtual const std::string & | getUnit ()=0 |
virtual const std::string & | getDescription ()=0 |
virtual void | fillSendBuffer ()=0 |
Fill the send buffer with data and version number. More... | |
Public Attributes | |
NDRegisterAccessor< UserType >::Buffer | _sendBuffer |
AsyncVariableImpl contains a weak pointer to an AsyncNDRegisterAccessor<UserType> and a send buffer NDRegisterAccessor<UserType>::Buffer.
This class provides implementation for those functions of the AsyncVariable which touch the AsyncNDRegisterAccessor. It does implement the functions which provide the information needed to create an AsyncNDRegisterAccessor, like getNumberOfChannels(). These are backend specific and need a dedicated implementation per backend.
The AsyncVariableManager cannot hold a shared pointer of the AsyncNDRegisterAccessor because then you could never get rid of a created accessor, which means the manager would just keep growing in memory if accessors are dynamically created and removed. Hence a weak pointer is used, and this class provides all the functions that access this weak pointer and do all the locking and nullptr checking.
Definition at line 166 of file AsyncAccessorManager.h.
ChimeraTK::async::AsyncVariableImpl< UserType >::AsyncVariableImpl | ( | size_t | nChannels, |
size_t | nElements | ||
) |
Definition at line 212 of file AsyncAccessorManager.h.
|
overridevirtual |
Helper functions for the creation of an AsyncNDRegisterAccessor.
As the creating code cannot use the catalogue, each backend has to implement these functions appropriately.
Implements ChimeraTK::async::AsyncVariable.
Reimplemented in ChimeraTK::async::PolledAsyncVariable< UserType >.
Definition at line 197 of file AsyncAccessorManager.h.
|
overridevirtual |
Implements ChimeraTK::async::AsyncVariable.
Reimplemented in ChimeraTK::async::PolledAsyncVariable< UserType >.
Definition at line 203 of file AsyncAccessorManager.h.
|
finalvirtual |
Send the value from the _sendBuffer of the AsyncVariableImpl.
The buffer has to be prepared before calling this function (incl. version number and data validity flag). The buffer is swapped out to avoid unnecessary copies. If you need a copy, you have to make one before calling this function.
Implements ChimeraTK::async::AsyncVariable.
Definition at line 217 of file AsyncAccessorManager.h.
|
finalvirtual |
Send an exception to all subscribers.
Must only be called from within deactivateAsyncAndExecute().
Implements ChimeraTK::async::AsyncVariable.
Definition at line 188 of file AsyncAccessorManager.h.
NDRegisterAccessor<UserType>::Buffer ChimeraTK::async::AsyncVariableImpl< UserType >::_sendBuffer |
Definition at line 174 of file AsyncAccessorManager.h.