diff --git a/include/ConstantAccessor.h b/include/ConstantAccessor.h index 62c597a8a8e7edea7f1d4e2c7b5c235fb3d23d99..8328cf13b281f2f3981929b9cf0e683e8c09b720 100644 --- a/include/ConstantAccessor.h +++ b/include/ConstantAccessor.h @@ -52,7 +52,7 @@ namespace ChimeraTK { bool doReadTransferLatest() override { return doReadTransferNonBlocking(); } - void doPostRead(TransferType /*type*/) override { ChimeraTK::NDRegisterAccessor<UserType>::buffer_2D[0] = _value; } + void doPostRead(TransferType /*type*/, bool /* hasNewData */) override { ChimeraTK::NDRegisterAccessor<UserType>::buffer_2D[0] = _value; } bool doWriteTransfer(ChimeraTK::VersionNumber /*versionNumber*/ = {}) override { return true; } diff --git a/include/ConsumingFanOut.h b/include/ConsumingFanOut.h index 7ccbff1a1f8efd54f538f785ffe4d14819d7ae8b..835618d4105745b405a2bee1c54adc83bba85876 100644 --- a/include/ConsumingFanOut.h +++ b/include/ConsumingFanOut.h @@ -26,8 +26,8 @@ namespace ChimeraTK { assert(feedingImpl->isReadable()); } - void doPostRead(TransferType type) override { - ChimeraTK::NDRegisterAccessorDecorator<UserType>::doPostRead(type); + void doPostRead(TransferType type, bool hasNewData) override { + ChimeraTK::NDRegisterAccessorDecorator<UserType>::doPostRead(type, hasNewData); for(auto& slave : FanOut<UserType>::slaves) { // send out copies to slaves // do not send copy if no data is expected (e.g. trigger) if(slave->getNumberOfSamples() != 0) { diff --git a/include/DebugPrintAccessorDecorator.h b/include/DebugPrintAccessorDecorator.h index 9c25ec4b14555b5720277bcc3ebd9c437172ac76..567f4ad6d966c6c3ce998176fbaada7645e515ca 100644 --- a/include/DebugPrintAccessorDecorator.h +++ b/include/DebugPrintAccessorDecorator.h @@ -60,9 +60,9 @@ namespace ChimeraTK { ChimeraTK::NDRegisterAccessorDecorator<UserType>::doPreRead(type); } - void doPostRead(TransferType type) override { + void doPostRead(TransferType type, bool hasNewData) override { std::cout << "postRead() called on '" << _fullyQualifiedName << "'." << std::endl; - ChimeraTK::NDRegisterAccessorDecorator<UserType>::doPostRead(type); + ChimeraTK::NDRegisterAccessorDecorator<UserType>::doPostRead(type, hasNewData); } void doPreWrite(TransferType type) override { @@ -70,9 +70,9 @@ namespace ChimeraTK { ChimeraTK::NDRegisterAccessorDecorator<UserType>::doPreWrite(type); } - void doPostWrite(TransferType type) override { + void doPostWrite(TransferType type, bool dataLost) override { std::cout << "postWrite() called on '" << _fullyQualifiedName << "'." << std::endl; - ChimeraTK::NDRegisterAccessorDecorator<UserType>::doPostWrite(type); + ChimeraTK::NDRegisterAccessorDecorator<UserType>::doPostWrite(type, dataLost); } protected: diff --git a/include/FeedingFanOut.h b/include/FeedingFanOut.h index aa2e3fac8fd6153556c4bb53e15ea2eb73e0b4f7..9703c6558e097fd2eabb8e1fc50b4087cf4739fb 100644 --- a/include/FeedingFanOut.h +++ b/include/FeedingFanOut.h @@ -89,10 +89,10 @@ namespace ChimeraTK { _returnSlave->preRead(type); } - void doPostRead(TransferType type) override { + void doPostRead(TransferType type, bool hasNewData) override { if(!_withReturn) throw ChimeraTK::logic_error("Read operation called on write-only variable."); assert(_hasReturnSlave); - _returnSlave->postRead(type); + _returnSlave->postRead(type, hasNewData); _returnSlave->accessChannel(0).swap(ChimeraTK::NDRegisterAccessor<UserType>::buffer_2D[0]); // distribute return-channel update to the other slaves for(auto& slave : FanOut<UserType>::slaves) { // send out copies to slaves @@ -154,9 +154,9 @@ namespace ChimeraTK { return dataLost; } - void doPostWrite(TransferType type) override { + void doPostWrite(TransferType type, bool dataLost) override { for(auto& slave : FanOut<UserType>::slaves) { - slave->postWrite(type); + slave->postWrite(type, dataLost); } FanOut<UserType>::slaves.front()->accessChannel(0).swap(ChimeraTK::NDRegisterAccessor<UserType>::buffer_2D[0]); } diff --git a/include/MetaDataPropagatingRegisterDecorator.h b/include/MetaDataPropagatingRegisterDecorator.h index 77e6e41f1c2065b123d53f6ce9efc784fd3837be..6523a65835bdb26f9a2fd213347db012a89befa4 100644 --- a/include/MetaDataPropagatingRegisterDecorator.h +++ b/include/MetaDataPropagatingRegisterDecorator.h @@ -33,7 +33,7 @@ namespace ChimeraTK { NDRegisterAccessorDecorator<T, T>::doPreRead(type); } - void doPostRead(TransferType type) override; + void doPostRead(TransferType type, bool hasNewData) override; void doPreWrite(TransferType type) override; protected: diff --git a/include/TestableModeAccessorDecorator.h b/include/TestableModeAccessorDecorator.h index f396953530cd8b074b6a6fe8ab638de1a3de8374..a83bdd937ba95011e69b26df8f4c1e1f825b3a24 100644 --- a/include/TestableModeAccessorDecorator.h +++ b/include/TestableModeAccessorDecorator.h @@ -175,9 +175,9 @@ namespace ChimeraTK { return true; } - void doPostRead(TransferType type) override { + void doPostRead(TransferType type, bool hasNewData) override { if(_handleRead) obtainLockAndDecrementCounter(); - ChimeraTK::NDRegisterAccessorDecorator<UserType>::doPostRead(type); + ChimeraTK::NDRegisterAccessorDecorator<UserType>::doPostRead(type, hasNewData); } protected: diff --git a/src/MetaDataPropagatingRegisterDecorator.cc b/src/MetaDataPropagatingRegisterDecorator.cc index 45981e01f737026f8df3a43350c46d9b1b29d253..42d26482b7cdd11452875b1bdfb0740eeb40b7f8 100644 --- a/src/MetaDataPropagatingRegisterDecorator.cc +++ b/src/MetaDataPropagatingRegisterDecorator.cc @@ -4,8 +4,8 @@ namespace ChimeraTK { template<typename T> - void MetaDataPropagatingRegisterDecorator<T>::doPostRead(TransferType type) { - NDRegisterAccessorDecorator<T, T>::doPostRead(type); + void MetaDataPropagatingRegisterDecorator<T>::doPostRead(TransferType type, bool hasNewData) { + NDRegisterAccessorDecorator<T, T>::doPostRead(type, hasNewData); // update the version number if(!isNonblockingRead) {