aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/generation_tracker.hpp
blob: 291fbbcfb367b8aeb46e0afeed77cd09ebefd2ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include <yacppdic/factory.hpp>

#include <cstdint>
#include <memory>

// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
class IGenerationTracker
{
public:
	virtual ~IGenerationTracker() noexcept = default;

	[[nodiscard]] virtual auto get_current_generation() const noexcept
		-> std::uint32_t = 0;

	virtual void set_current_generation(std::uint32_t current_generation) noexcept = 0;

	[[nodiscard]] virtual auto get_is_paused() const noexcept -> bool = 0;

	virtual void set_is_paused(bool is_paused) noexcept = 0;
};

using IGenerationTrackerFactory =
	yacppdic::Factory<std::unique_ptr<IGenerationTracker>(bool is_paused)>;