2021-12-11 02:12:49 +01:00
|
|
|
#ifndef FORTUNA_ENTROPY_SRC_H
|
|
|
|
#define FORTUNA_ENTROPY_SRC_H
|
|
|
|
|
|
|
|
#include "event_adder_impl.h"
|
2022-01-13 05:40:33 +01:00
|
|
|
#include "event_scheduler_impl.h"
|
|
|
|
|
|
|
|
#include <memory>
|
2021-12-11 02:12:49 +01:00
|
|
|
|
|
|
|
namespace fortuna {
|
|
|
|
namespace accumulator {
|
|
|
|
|
|
|
|
class EntropySrc {
|
2022-01-10 04:25:03 +01:00
|
|
|
private:
|
2022-01-13 05:40:33 +01:00
|
|
|
std::unique_ptr<EventAdderImpl> ea_impl;
|
|
|
|
std::unique_ptr<EventSchedulerImpl> es_impl;
|
2022-01-10 04:25:03 +01:00
|
|
|
|
2021-12-11 02:12:49 +01:00
|
|
|
public:
|
2022-01-13 05:40:33 +01:00
|
|
|
virtual void schedule(accumulator::EventSchedulerImpl scheduler) = 0;
|
2021-12-11 02:12:49 +01:00
|
|
|
virtual void event(accumulator::EventAdderImpl adder) = 0;
|
|
|
|
|
2022-01-02 07:35:00 +01:00
|
|
|
static constexpr const std::size_t max_event_length{32};
|
|
|
|
|
2021-12-11 02:12:49 +01:00
|
|
|
EntropySrc(const EntropySrc&) = delete;
|
|
|
|
EntropySrc& operator=(const EntropySrc&) = delete;
|
|
|
|
~EntropySrc() noexcept;
|
|
|
|
};
|
|
|
|
|
2022-01-10 04:25:03 +01:00
|
|
|
} // namespace accumulator
|
|
|
|
} // namespace fortuna
|
|
|
|
#endif // FORTUNA_ENTROPY_SRC_H
|