From 4efb857652ab09f3e7841f89ea7bce129b1c08bc Mon Sep 17 00:00:00 2001 From: vuurvlieg Date: Tue, 2 Apr 2024 20:58:43 +0200 Subject: [PATCH] Document walk methods --- src/core/Group.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/core/Group.h b/src/core/Group.h index 3a0e570d1..2bbfeb175 100644 --- a/src/core/Group.h +++ b/src/core/Group.h @@ -180,7 +180,19 @@ public: QList groupsRecursive(bool includeSelf) const; QList groupsRecursive(bool includeSelf); - // walk methods for traversing the tree efficiently (depth-first search) + /** + * Walk methods for traversing the tree (depth-first search) + * + * @param[in] includeSelf is the current group to be included or excluded + * if `false` the current group's entries will not be included either + * @param[in] groupVisitor functor that takes a single argument: ([const] Group*) + * the functor may return a bool to indicate whether to stop=`true` or continue=`false` traversing + * for a non-`bool` return-type the value is ignored and the traversing will continue as if `false` had been returned + * @param[in] entryVisitor functor that takes a single argument: ([const] Entry*) + * the functor may return a bool to indicate whether to stop=`true` or continue=`false` traversing + * for a non-`bool` return-type the value is ignored and the traversing will continue as if `false` had been returned + * @return `false` if the traversing completed without stop, or `true` otherwise + */ template bool walk(bool includeSelf, TGroupCallable&& groupVisitor, TEntryCallable&& entryVisitor) {