Added method for incrementing the repetition count manually.

This commit is contained in:
2026-09-17 16:26:35 +02:00
parent a3bfa75103
commit 4a58251173
2 changed files with 16 additions and 1 deletions
+4
View File
@@ -111,4 +111,8 @@ size_t msgPrintControl::repetitionCount(msgPrintControlKey &key) {
return map_[key];
}
void msgPrintControl::incrementRepetitionCount(msgPrintControlKey &key) {
map_[key]++;
}
char *msgPrintControl::getSuffix() { return suffix_; }
+12 -1
View File
@@ -197,13 +197,24 @@ class HIDDEN msgPrintControl {
* @brief Returns the repetition count for the given key.
*
* If the key does not exist in the internal map of msgPrintControl, this
* method returns 0.
* method inserts it with value 0 and returns 0.
*
* @param key
* @return size_t
*/
size_t repetitionCount(msgPrintControlKey &key);
/**
* @brief Increment the repetition count for the given key by 1.
*
* If the key does not exist in the internal map of msgPrintControl, this
* method inserts it with value 1.
*
* @param key
* @return size_t
*/
void incrementRepetitionCount(msgPrintControlKey &key);
/**
* @brief shouldBePrinted might create a suffix ("maximum number of
* repetitions reached, further messages will be suppressed until reset.").