From: 김용섭/On-Device Lab(SR)/Engineer/삼성전자 Date: Thu, 29 Aug 2019 07:25:31 +0000 (+0900) Subject: [neurun] Add iterate() to FunctionSequence (#6977) X-Git-Tag: accepted/tizen/unified/20190903.052428~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64a08a9bc0ec648186582a54d2323d603ade83c5;p=platform%2Fcore%2Fml%2Fnnfw.git [neurun] Add iterate() to FunctionSequence (#6977) Add iterate() to FunctionSequence for #6156 Signed-off-by: Yongseop Kim --- diff --git a/runtimes/neurun/core/src/exec/FunctionSequence.cc b/runtimes/neurun/core/src/exec/FunctionSequence.cc index d3b6f1f..00214fc 100644 --- a/runtimes/neurun/core/src/exec/FunctionSequence.cc +++ b/runtimes/neurun/core/src/exec/FunctionSequence.cc @@ -50,5 +50,13 @@ void FunctionSequence::append(std::unique_ptr &&function) _functions.push_back(std::move(function)); } +void FunctionSequence::iterate(const std::function &fn) +{ + for (const auto &func : _functions) + { + fn(*func); + } +} + } // namespace exec } // namespace neurun diff --git a/runtimes/neurun/core/src/exec/FunctionSequence.h b/runtimes/neurun/core/src/exec/FunctionSequence.h index b61d3c0..2ba5c0b 100644 --- a/runtimes/neurun/core/src/exec/FunctionSequence.h +++ b/runtimes/neurun/core/src/exec/FunctionSequence.h @@ -19,6 +19,7 @@ #include #include +#include #include "exec/IFunction.h" @@ -43,6 +44,8 @@ public: */ void append(std::unique_ptr &&function); + void iterate(const std::function &fn); + private: std::vector> _functions; };