From de50cd15f12216760bb746ec8936fc1501113425 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 22 Aug 2021 13:09:25 +0100 Subject: Add EventCounter class --- lib/eventCounter.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lib/eventCounter.h (limited to 'lib/eventCounter.h') 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 + +namespace MyGrate { + class EventCounter { + public: + using Counters = std::array; + + 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 -- cgit v1.2.3