diff options
author | HampusM <hampus@hampusmat.com> | 2022-06-02 20:07:09 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:57:00 +0200 |
commit | cf3bfd60ad03f2feb2ccc62a12fc2922bdc2fb71 (patch) | |
tree | 9ea6c1465ec499cff6b24fe57d1a1b2e469a2dd1 /src/interfaces | |
parent | eecf4b1e666211a13afa56f93477c55e8fd01621 (diff) |
refactor: remove randomization & argument parser
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/argument_parser.hpp | 28 | ||||
-rw-r--r-- | src/interfaces/randomization.hpp | 33 |
2 files changed, 0 insertions, 61 deletions
diff --git a/src/interfaces/argument_parser.hpp b/src/interfaces/argument_parser.hpp deleted file mode 100644 index 6415422..0000000 --- a/src/interfaces/argument_parser.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include "interfaces/randomization.hpp" - -#include <getopt.h> -#include <memory> -#include <string_view> -#include <vector> - -struct ParsedArguments -{ - std::shared_ptr<IRandomNumberGenerator> random_gen = nullptr; -}; - -// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) -class IArgumentParser -{ -public: - virtual ~IArgumentParser() noexcept = default; - - virtual auto parse( - const std::vector<option> &options, - const std::string_view &short_options, - const int &argc, - char *const *argv) noexcept - -> ParsedArguments = 0; // NOLINT(cppcoreguidelines-avoid-c-arrays, - // modernize-avoid-c-arrays) -}; diff --git a/src/interfaces/randomization.hpp b/src/interfaces/randomization.hpp deleted file mode 100644 index 06f7d49..0000000 --- a/src/interfaces/randomization.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#include <yacppdic/factory.hpp> - -#include <memory> - -// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) -class ISeedGenerator -{ -public: - virtual ~ISeedGenerator() noexcept = default; - - [[nodiscard]] virtual auto random_seed() noexcept -> uint32_t = 0; -}; - -// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) -class IRandomNumberGenerator -{ -public: - virtual ~IRandomNumberGenerator() noexcept = default; - - /** - * Returns a number in the range of a to b. - * - * @param a A number lower than b - * @param b A number greater than a - */ - [[nodiscard]] virtual auto - in_range(const uint32_t &a, const uint32_t &b) const noexcept -> uint32_t = 0; -}; - -using IRandomNumberGeneratorFactory = - yacppdic::Factory<std::unique_ptr<IRandomNumberGenerator>(const uint32_t &seed)>; |