Skip to content
Snippets Groups Projects
Commit 01f4306a authored by Martin Killenberg's avatar Martin Killenberg
Browse files

wip: TriggerFanOut is now propagating the data validity correctly

parent e1376034
No related branches found
No related tags found
No related merge requests found
...@@ -109,8 +109,8 @@ namespace ChimeraTK { ...@@ -109,8 +109,8 @@ namespace ChimeraTK {
/** Functor class to send data to the consumers, suitable for /** Functor class to send data to the consumers, suitable for
* boost::fusion::for_each(). */ * boost::fusion::for_each(). */
struct SendDataToConsumers { struct SendDataToConsumers {
SendDataToConsumers(VersionNumber version, DataValidity validity = DataValidity::ok) SendDataToConsumers(VersionNumber version, DataValidity triggerValidity = DataValidity::ok)
: _version(version), _validity(validity) {} : _version(version), _triggerValidity(triggerValidity) {}
template<typename PAIR> template<typename PAIR>
void operator()(PAIR& pair) const { void operator()(PAIR& pair) const {
...@@ -121,7 +121,9 @@ namespace ChimeraTK { ...@@ -121,7 +121,9 @@ namespace ChimeraTK {
for(auto& network : theMap) { for(auto& network : theMap) {
auto feeder = network.first; auto feeder = network.first;
auto fanOut = network.second; auto fanOut = network.second;
fanOut->setDataValidity(_validity); fanOut->setDataValidity((_triggerValidity == DataValidity::ok && feeder->dataValidity() == DataValidity::ok) ?
DataValidity::ok :
DataValidity::faulty);
fanOut->accessChannel(0).swap(feeder->accessChannel(0)); fanOut->accessChannel(0).swap(feeder->accessChannel(0));
// don't use write destructively. In case of an exception we still need the data for the next read (see Exception Handling spec B.2.2.6) // don't use write destructively. In case of an exception we still need the data for the next read (see Exception Handling spec B.2.2.6)
bool dataLoss = fanOut->write(_version); bool dataLoss = fanOut->write(_version);
...@@ -132,7 +134,7 @@ namespace ChimeraTK { ...@@ -132,7 +134,7 @@ namespace ChimeraTK {
} }
VersionNumber _version; VersionNumber _version;
DataValidity _validity; DataValidity _triggerValidity;
}; };
/** TransferElement acting as our trigger */ /** TransferElement acting as our trigger */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment