summaryrefslogtreecommitdiff
path: root/lib/eventCounter.h
blob: 522310a28c032024e305dc403104bfea64c12f88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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