From: Samuel Just Date: Wed, 28 Sep 2022 23:10:15 +0000 (-0700) Subject: crimson/common/operation: add OpRegistryT::for_each_op X-Git-Tag: v18.1.0~1068^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6bb0c1fb29cc1c24c6cb010f485ae477c7983680;p=ceph.git crimson/common/operation: add OpRegistryT::for_each_op Signed-off-by: Samuel Just --- diff --git a/src/crimson/common/operation.h b/src/crimson/common/operation.h index c39ecea37a7..9922ddccfc2 100644 --- a/src/crimson/common/operation.h +++ b/src/crimson/common/operation.h @@ -441,6 +441,16 @@ protected: } public: + /// Iterate over live ops + template + void for_each_op(F &&f) const { + for (const auto ®istry: registries) { + for (const auto &op: registry) { + std::invoke(f, op); + } + } + } + /// Removes op from registry void remove_from_registry(Operation &op) { const auto op_type = op.get_type();