From 20868617768a2770ad7b6c2809547d8037f93622 Mon Sep 17 00:00:00 2001 From: surtur Date: Wed, 29 Dec 2021 03:49:36 +0100 Subject: [PATCH] accumulator: implement add_source() --- accumulator.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/accumulator.h b/accumulator.h index 0ddf2d8..da1ac1d 100644 --- a/accumulator.h +++ b/accumulator.h @@ -1,6 +1,7 @@ #ifndef FORTUNA_ACCUMULATOR_H #define FORTUNA_ACCUMULATOR_H +#include "event_adder_impl.h" #include "generator.h" #include "pool.h" #include @@ -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);