chore(pool): add const& qual, #include stuff
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e78ac038db
commit
e899c03da2
16
pool.cpp
16
pool.cpp
|
@ -3,15 +3,23 @@
|
|||
|
||||
#include "pool.h"
|
||||
|
||||
#include <fmt/core.h>
|
||||
|
||||
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<char>& 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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
8
pool.h
8
pool.h
|
@ -3,8 +3,6 @@
|
|||
|
||||
#include "util.h"
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <stdexcept>
|
||||
|
||||
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<char>& event) -> int;
|
||||
|
|
Reference in New Issue