forked from ak-fortuna/fortuna
accumulator: add event_scheduler,entropy_src ifces
This commit is contained in:
parent
2fbf5464a0
commit
a5b988ba71
@ -183,7 +183,7 @@ add_subdirectory(lib/fmt EXCLUDE_FROM_ALL)
|
|||||||
endif(NOT CMAKE_EXE_LINKER_FLAGS MATCHES "-fuse-ld=lld")
|
endif(NOT CMAKE_EXE_LINKER_FLAGS MATCHES "-fuse-ld=lld")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(fortuna main.cpp generator.cpp generator.h fortuna.cpp fortuna.h accumulator.cpp accumulator.h pool.cpp pool.h event_adder.h event_adder_impl.h)
|
add_executable(fortuna main.cpp generator.cpp generator.h fortuna.cpp fortuna.h accumulator.cpp accumulator.h pool.cpp pool.h event_adder.h event_adder_impl.h event_scheduler.h entropy_src.h)
|
||||||
# ref: https://cmake.org/pipermail/cmake/2016-May/063400.html
|
# ref: https://cmake.org/pipermail/cmake/2016-May/063400.html
|
||||||
target_link_libraries(fortuna
|
target_link_libraries(fortuna
|
||||||
PRIVATE cryptopp
|
PRIVATE cryptopp
|
||||||
|
22
entropy_src.h
Normal file
22
entropy_src.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef FORTUNA_ENTROPY_SRC_H
|
||||||
|
#define FORTUNA_ENTROPY_SRC_H
|
||||||
|
|
||||||
|
#include "event_adder_impl.h"
|
||||||
|
#include "event_scheduler.h"
|
||||||
|
|
||||||
|
namespace fortuna {
|
||||||
|
namespace accumulator {
|
||||||
|
|
||||||
|
class EntropySrc {
|
||||||
|
public:
|
||||||
|
virtual void schedule(accumulator::EventScheduler scheduler) = 0;
|
||||||
|
virtual void event(accumulator::EventAdderImpl adder) = 0;
|
||||||
|
|
||||||
|
EntropySrc(const EntropySrc&) = delete;
|
||||||
|
EntropySrc& operator=(const EntropySrc&) = delete;
|
||||||
|
~EntropySrc() noexcept;
|
||||||
|
};
|
||||||
|
|
||||||
|
} //namespace accumulator
|
||||||
|
} //namespace fortuna
|
||||||
|
#endif//FORTUNA_ENTROPY_SRC_H
|
22
event_scheduler.h
Normal file
22
event_scheduler.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef FORTUNA_EVENT_SCHEDULER_H
|
||||||
|
#define FORTUNA_EVENT_SCHEDULER_H
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
|
namespace fortuna {
|
||||||
|
namespace accumulator {
|
||||||
|
|
||||||
|
class EventScheduler {
|
||||||
|
public:
|
||||||
|
virtual void schedule(std::chrono::milliseconds delay_ms) = 0;
|
||||||
|
|
||||||
|
EventScheduler(const EventScheduler&) = delete;
|
||||||
|
EventScheduler& operator=(const EventScheduler&) = delete;
|
||||||
|
~EventScheduler() noexcept;
|
||||||
|
};
|
||||||
|
|
||||||
|
} //namespace accumulator
|
||||||
|
} //namespace fortuna
|
||||||
|
|
||||||
|
#endif//FORTUNA_EVENT_SCHEDULER_H
|
||||||
|
|
Loading…
Reference in New Issue
Block a user