106 std::lock_guard l(_mutex);
118 auto subDomain = _subDomain.lock();
123 if(version >= _notDistributedVersion) {
124 subDomain->activate(data, version);
125 _activationVersion = version;
129 subDomain->activate(_notDistributedData, _notDistributedVersion);
130 _activationVersion = _notDistributedVersion;
132 return _activationVersion;
170 std::lock_guard l(_mutex);
172 auto subDomain = _subDomain.lock();
174 subDomain = boost::make_shared<SubDomain<BackendDataType>>(
175 _backend, std::vector<size_t>({_id}),
nullptr, shared_from_this());
176 _subDomain = subDomain;
179 return subDomain->template subscribe<UserDataType>(name, numberOfWords, wordOffsetInRegister, flags);
The Domain is the thread-safe entry point for each distribution tree.
VersionNumber _notDistributedVersion
void sendException(const std::exception_ptr &e) noexcept override
VersionNumber activate(BackendDataType data, VersionNumber version=VersionNumber{nullptr})
Activate and distribute the initial value.
boost::weak_ptr< SubDomain< BackendDataType > > _subDomain
VersionNumber distribute(BackendDataType data, VersionNumber version=VersionNumber{nullptr})
Distribute the data via the associated distribution tree.
VersionNumber _activationVersion
DomainImpl(boost::shared_ptr< DeviceBackend > backend, size_t domainId)
boost::shared_ptr< AsyncNDRegisterAccessor< UserDataType > > subscribe(RegisterPath name, size_t numberOfWords, size_t wordOffsetInRegister, AccessModeFlags flags)
void deactivate() override
BackendDataType _notDistributedData
boost::shared_ptr< DeviceBackend > _backend