surtur
03578f9016
All checks were successful
continuous-integration/drone/push Build is passing
* add event_scheduler_impl.h and properly override its base class * add urandom_entropy_src.cpp, move there logic from header * add urandom_entropy_src.cpp to CMakeLists.txt * add unique_ptr per impl: one for both EventSchedulerImpl and EventAdderImpl each * wrap a call in reinterpret_cast and reformat code * add missing includes (best effort)
31 lines
710 B
C++
31 lines
710 B
C++
#ifndef FORTUNA_ENTROPY_SRC_H
|
|
#define FORTUNA_ENTROPY_SRC_H
|
|
|
|
#include "event_adder_impl.h"
|
|
#include "event_scheduler_impl.h"
|
|
|
|
#include <memory>
|
|
|
|
namespace fortuna {
|
|
namespace accumulator {
|
|
|
|
class EntropySrc {
|
|
private:
|
|
std::unique_ptr<EventAdderImpl> ea_impl;
|
|
std::unique_ptr<EventSchedulerImpl> es_impl;
|
|
|
|
public:
|
|
virtual void schedule(accumulator::EventSchedulerImpl scheduler) = 0;
|
|
virtual void event(accumulator::EventAdderImpl adder) = 0;
|
|
|
|
static constexpr const std::size_t max_event_length{32};
|
|
|
|
EntropySrc(const EntropySrc&) = delete;
|
|
EntropySrc& operator=(const EntropySrc&) = delete;
|
|
~EntropySrc() noexcept;
|
|
};
|
|
|
|
} // namespace accumulator
|
|
} // namespace fortuna
|
|
#endif // FORTUNA_ENTROPY_SRC_H
|