38 lines
709 B
C
38 lines
709 B
C
|
#ifndef FORTUNA_SEED_FILE_MANAGER_H
|
||
|
#define FORTUNA_SEED_FILE_MANAGER_H
|
||
|
|
||
|
#include <chrono>
|
||
|
#include <string>
|
||
|
|
||
|
#include "accumulator.h"
|
||
|
#include "do_task.h"
|
||
|
|
||
|
namespace fortuna {
|
||
|
|
||
|
class SeedFileManager {
|
||
|
public:
|
||
|
struct conf
|
||
|
{
|
||
|
std::chrono::minutes write_interval{10};
|
||
|
std::string seed_f_path = "./fortuna.seed";
|
||
|
std::size_t seed_f_length = 64;
|
||
|
|
||
|
conf(){};
|
||
|
};
|
||
|
|
||
|
private:
|
||
|
const conf config;
|
||
|
DoTask do_task;
|
||
|
fortuna::accumulator::Accumulator& accumulator;
|
||
|
|
||
|
auto write_seed_file() -> void;
|
||
|
auto update_seed_file() -> void;
|
||
|
|
||
|
public:
|
||
|
SeedFileManager(conf config, fortuna::accumulator::Accumulator& accumulator);
|
||
|
}; // class SeedFileManager
|
||
|
|
||
|
} // namespace fortuna
|
||
|
|
||
|
#endif // FORTUNA_SEED_FILE_MANAGER_H
|