From 7bb319b21e6e89efe77d3a96f12d3e284d7f62e6 Mon Sep 17 00:00:00 2001 From: Jason Dellaluce Date: Tue, 30 Aug 2022 12:39:20 +0000 Subject: [PATCH] update(userspace/falco): add convenience method for merging app run results Signed-off-by: Jason Dellaluce --- userspace/falco/application.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/userspace/falco/application.h b/userspace/falco/application.h index c37df9c7..15365301 100644 --- a/userspace/falco/application.h +++ b/userspace/falco/application.h @@ -147,6 +147,21 @@ private: return r; } + // Merges two run results into one + inline static run_result merge(const run_result& a, const run_result& b) + { + auto res = ok(); + res.proceed = a.proceed && b.proceed; + res.success = a.success && b.success; + res.errstr = a.errstr; + if (!b.errstr.empty()) + { + res.errstr += res.errstr.empty() ? "" : "\n"; + res.errstr += b.errstr; + } + return res; + } + run_result(); virtual ~run_result();