diff --git a/pool.cpp b/pool.cpp index c6d9d3e..ed6ff1d 100644 --- a/pool.cpp +++ b/pool.cpp @@ -3,15 +3,23 @@ #include "pool.h" +#include + namespace fortuna { namespace accumulator { -auto Pool::set_id(unsigned int id) -> void { - pool_id = id; +auto Pool::set_id(const unsigned int& id) noexcept -> void { + this->pool_id = id; } -auto Pool::initialize_pool(unsigned int id) -> void { +auto Pool::get_id() const noexcept -> unsigned int { + return this->pool_id; +} + +auto Pool::initialize_pool(const unsigned int& id) -> void { + fmt::print("\tpool init: {}\n", id); set_id(id); + fmt::print("\tid set to: {}\n", this->get_id()); } auto Pool::add_entropy(const uint source, const std::vector& event) @@ -72,7 +80,7 @@ auto Pool::append_s(const std::string& entropy_s) -> void { (this->s).append(std::string(entropy_s)); } catch (const std::exception& e) { - fmt::print("{}", e.what()); + fmt::print("{}\n", e.what()); } } diff --git a/pool.h b/pool.h index 7f46f78..96d7f55 100644 --- a/pool.h +++ b/pool.h @@ -3,8 +3,6 @@ #include "util.h" -#include -#include namespace fortuna { namespace accumulator { @@ -15,11 +13,11 @@ public: Pool(const Pool& pool) = delete; // no copy ~Pool() noexcept = default; - auto set_id(unsigned int id) -> void; + auto set_id(const unsigned int& id) noexcept -> void; - auto get_id() const -> unsigned int; + auto get_id() const noexcept -> unsigned int; - auto initialize_pool(unsigned int id) -> void; + auto initialize_pool(const unsigned int& id) -> void; // add entropy contained in a random event of 1 to 32 bytes auto add_entropy(const uint source, const std::vector& event) -> int;