ChimeraTK-DeviceAccess
03.18.00
|
#include <DomainImpl.h>
Public Member Functions | |
DomainImpl (boost::shared_ptr< DeviceBackend > backend, size_t domainId) | |
VersionNumber | distribute (BackendDataType data, VersionNumber version=VersionNumber{nullptr}) |
Distribute the data via the associated distribution tree. More... | |
VersionNumber | activate (BackendDataType data, VersionNumber version=VersionNumber{nullptr}) |
Activate and distribute the initial value. More... | |
void | deactivate () override |
void | sendException (const std::exception_ptr &e) noexcept override |
template<typename UserDataType > | |
boost::shared_ptr< AsyncNDRegisterAccessor< UserDataType > > | subscribe (RegisterPath name, size_t numberOfWords, size_t wordOffsetInRegister, AccessModeFlags flags) |
Public Member Functions inherited from ChimeraTK::async::Domain | |
virtual | ~Domain ()=default |
std::lock_guard< std::mutex > | getDomainLock () |
Protected Attributes | |
boost::weak_ptr< SubDomain< BackendDataType > > | _subDomain |
boost::shared_ptr< DeviceBackend > | _backend |
size_t | _id |
BackendDataType | _notDistributedData |
VersionNumber | _notDistributedVersion {nullptr} |
VersionNumber | _activationVersion {nullptr} |
Protected Attributes inherited from ChimeraTK::async::Domain | |
std::mutex | _mutex |
bool | _isActive {false} |
Additional Inherited Members | |
Protected Member Functions inherited from ChimeraTK::async::Domain | |
bool | unsafeGetIsActive () const |
Friend classes are allowed to read the _isActiveFlag without acquiring the mutex. More... | |
Definition at line 15 of file DomainImpl.h.
|
inline |
Definition at line 17 of file DomainImpl.h.
VersionNumber ChimeraTK::async::DomainImpl< BackendDataType >::activate | ( | BackendDataType | data, |
VersionNumber | version = VersionNumber{nullptr} |
||
) |
Activate and distribute the initial value.
If the backend can determine a version number from the data, it has to do this before calling distribute and give the version as an argument. Otherwise a new version is created under the domain lock.
In case distribute has been called before with a version number newer than the version of the polled initial value, these data and version number are distributed instead.
@ return The version number that has been used for distribution.
Definition at line 105 of file DomainImpl.h.
|
overridevirtual |
Implements ChimeraTK::async::Domain.
Definition at line 134 of file DomainImpl.h.
VersionNumber ChimeraTK::async::DomainImpl< BackendDataType >::distribute | ( | BackendDataType | data, |
VersionNumber | version = VersionNumber{nullptr} |
||
) |
Distribute the data via the associated distribution tree.
If the backend can determine a version number from the data, it has to do this before calling distribute and give the version as an argument. Otherwise a new version is created under the domain lock.
As the asynchronous subscription with its thread has to be started before activate() is called, it can happen that distribute with newer data and a newer version number is called before activate is called with the initial value. In this case, the data is stored and no data is distributed. The data will later be distributed during activation instead of the older polled initial value. If data is stored for delayed distribution, the return value is VersionNumber{nullptr}.
In case distribute() is called after activate(), with a version number older than the polled initial value, the data is dropped and not distributed. In this case the return value is VersionNumber{nullptr}.
@ return The version number that has been used for distribution, or VersionNumber{nullptr} if there was no distribution.
Definition at line 75 of file DomainImpl.h.
|
overridevirtualnoexcept |
Implements ChimeraTK::async::Domain.
Definition at line 143 of file DomainImpl.h.
boost::shared_ptr< AsyncNDRegisterAccessor< UserDataType > > ChimeraTK::async::DomainImpl< BackendDataType >::subscribe | ( | RegisterPath | name, |
size_t | numberOfWords, | ||
size_t | wordOffsetInRegister, | ||
AccessModeFlags | flags | ||
) |
Definition at line 164 of file DomainImpl.h.
|
protected |
Definition at line 69 of file DomainImpl.h.
|
protected |
Definition at line 63 of file DomainImpl.h.
|
protected |
Definition at line 64 of file DomainImpl.h.
|
protected |
Definition at line 67 of file DomainImpl.h.
|
protected |
Definition at line 68 of file DomainImpl.h.
|
protected |
Definition at line 61 of file DomainImpl.h.