diff --git a/Framework/Core/include/Framework/DispatchPolicy.h b/Framework/Core/include/Framework/DispatchPolicy.h index 2ac7498aa58e7..8fc3c8563acf4 100644 --- a/Framework/Core/include/Framework/DispatchPolicy.h +++ b/Framework/Core/include/Framework/DispatchPolicy.h @@ -49,7 +49,9 @@ struct DispatchPolicy { /// the action to be used for matched devices DispatchOp action = DispatchOp::AfterComputation; /// matcher on specific output to trigger sending - TriggerMatcher triggerMatcher = [](Output const&) { return true; }; + TriggerMatcher triggerMatcher = defaultDispatchPolicy(); + + static TriggerMatcher defaultDispatchPolicy(); /// Helper to create the default configuration. static std::vector createDefaultPolicies(); diff --git a/Framework/Core/src/DispatchPolicy.cxx b/Framework/Core/src/DispatchPolicy.cxx index 9baea731a56f4..e8622e498a1eb 100644 --- a/Framework/Core/src/DispatchPolicy.cxx +++ b/Framework/Core/src/DispatchPolicy.cxx @@ -25,6 +25,11 @@ std::vector DispatchPolicy::createDefaultPolicies() return {DispatchPolicy{"dispatch-all-after-computation", [](DeviceSpec const&) { return true; }, DispatchPolicy::DispatchOp::AfterComputation}}; } +DispatchPolicy::TriggerMatcher DispatchPolicy::defaultDispatchPolicy() +{ + return DispatchPolicy::TriggerMatcher{[](Output const&) -> bool { return true; }}; +} + std::ostream& operator<<(std::ostream& oss, DispatchPolicy::DispatchOp const& val) { switch (val) {