accumulator: implement add_source()
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2021-12-29 03:49:36 +01:00
parent 234b87ff1f
commit 2086861776
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -1,6 +1,7 @@
#ifndef FORTUNA_ACCUMULATOR_H
#define FORTUNA_ACCUMULATOR_H
#include "event_adder_impl.h"
#include "generator.h"
#include "pool.h"
#include <algorithm>
@ -14,10 +15,19 @@ class Accumulator {
private:
fortuna::generator::Generator *Gen;
protected:
uint src_count{0};
public:
constexpr static const unsigned int init_pool_num{0};
auto add_source() -> void;
auto add_source() -> void {
static uint src_id{this->src_count};
++src_count;
accumulator::Pool pools[32];
EventAdderImpl event_adder(src_id, pools);
[[maybe_unused]] bool scheduled;
}
auto set_gen(fortuna::generator::Generator& Gen) -> void {
this->Gen = std::move(&Gen);