diff --git a/src/util/concurrentmap.hpp b/src/util/concurrentmap.hpp index 41b0ece3..d0602351 100644 --- a/src/util/concurrentmap.hpp +++ b/src/util/concurrentmap.hpp @@ -78,6 +78,18 @@ public: } } + void each(std::function func) + { + QMutexLocker lock(&this->mutex); + + QMutableMapIterator it(this->data); + + while (it.hasNext()) { + it.next(); + func(it.key(), it.value()); + } + } + private: mutable QMutex mutex; QMap data;