summaryrefslogtreecommitdiff
path: root/lib/eventCounter.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/eventCounter.h')
-rw-r--r--lib/eventCounter.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/eventCounter.h b/lib/eventCounter.h
new file mode 100644
index 0000000..522310a
--- /dev/null
+++ b/lib/eventCounter.h
@@ -0,0 +1,22 @@
+#ifndef MYGRATE_EVENTCOUNTER_H
+#define MYGRATE_EVENTCOUNTER_H
+
+#include "mariadb_repl.h"
+#include <array>
+
+namespace MyGrate {
+ class EventCounter {
+ public:
+ using Counters = std::array<unsigned long, ENUM_END_EVENT>;
+
+ void tick(mariadb_rpl_event);
+ const Counters & getAll() const;
+ unsigned long get(mariadb_rpl_event) const;
+ bool operator>=(const EventCounter &) const;
+
+ protected:
+ Counters counters {};
+ };
+}
+
+#endif