add fortuna class

This commit is contained in:
surtur 2021-11-10 23:55:58 +01:00
parent 40ae062657
commit ea11801789
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
4 changed files with 44 additions and 1 deletions

View File

@ -75,4 +75,4 @@ set(CMAKE_CXX_STANDARD 20)
endif(NOT CMAKE_EXE_LINKER_FLAGS MATCHES "-fuse-ld=lld")
endif()
add_executable(fortuna main.cpp generator.cpp generator.h)
add_executable(fortuna main.cpp generator.cpp generator.h fortuna.cpp fortuna.h)

21
fortuna.cpp Normal file
View File

@ -0,0 +1,21 @@
#include "fortuna.h"
#include "generator.h"
#ifndef FORTUNA_FORTUNA_CPP
#define FORTUNA_FORTUNA_CPP
namespace fortuna {
Fortuna::Fortuna(){
generator::Generator g{};
g.initialize_generator();
}
Fortuna::~Fortuna() = default;
auto Fortuna::random_data(unsigned int n_blocks) -> void {
// TODO(me)
// will one day return random data to the user
}
} // namespace fortuna
#endif//FORTUNA_FORTUNA_CPP

19
fortuna.h Normal file
View File

@ -0,0 +1,19 @@
#ifndef FORTUNA_FORTUNA_H
#define FORTUNA_FORTUNA_H
#include "generator.h"
namespace fortuna {
class Fortuna {
public:
Fortuna();
~Fortuna();
auto random_data(unsigned int) -> void;
private:
generator::Generator gen;
};
}
#endif//FORTUNA_FORTUNA_H

View File

@ -1,4 +1,5 @@
#include <iostream>
#include "fortuna.h"
#include "generator.h"
int main() {
@ -7,5 +8,7 @@ int main() {
cout << "[*] doing evil stuff" << endl;
fortuna::generator::Generator g{};
g.initialize_generator();
fortuna::Fortuna f;
f.random_data(4);
return 0;
}