This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
fortuna/seed_file_management.h
surtur 81e627998e
All checks were successful
continuous-integration/drone/push Build is passing
refactor(SeedFileManager)
2021-12-29 04:51:40 +01:00

39 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(){};
};
SeedFileManager(fortuna::accumulator::Accumulator& accumulator);
~SeedFileManager();
private:
const conf config;
DoTask do_task;
fortuna::accumulator::Accumulator accumulator;
auto write_seed_file() -> void;
auto update_seed_file() -> void;
}; // class SeedFileManager
} // namespace fortuna
#endif // FORTUNA_SEED_FILE_MANAGER_H