From 313fa15e785c78a92117aab2cc06c308ed0df782 Mon Sep 17 00:00:00 2001 From: Christoffer Lundell <chrlu470@student.liu.se> Date: Mon, 11 Mar 2024 11:13:02 +0100 Subject: [PATCH] Minor improvements --- include/RouterNode.h | 2 +- src/GuiTextArea.cpp | 2 +- src/RouterSimulator.cpp | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/RouterNode.h b/include/RouterNode.h index 935207f..f0b177a 100644 --- a/include/RouterNode.h +++ b/include/RouterNode.h @@ -11,7 +11,7 @@ class RouterSimulator; class RouterNode { public: RouterNode(const RouterNode&) = delete; - // std::vector requires RouterNode to be move-constructible + // std::vector<RouterNode> in RouterSimulator.h requires move constructor RouterNode(RouterNode&&) = default; RouterNode& operator=(const RouterNode&) = delete; RouterNode& operator=(RouterNode&&) = delete; diff --git a/src/GuiTextArea.cpp b/src/GuiTextArea.cpp index 6d1a270..13f8942 100644 --- a/src/GuiTextArea.cpp +++ b/src/GuiTextArea.cpp @@ -17,7 +17,7 @@ GuiTextArea::GuiTextArea(string const& title) textedit->setFont(font); textedit->setReadOnly(true); myGUI->setCentralWidget(textedit); - myGUI->setFixedSize(600, 600); + myGUI->setMinimumSize(600, 600); myGUI->setWindowTitle(QString::fromStdString(title)); myGUI->show(); } diff --git a/src/RouterSimulator.cpp b/src/RouterSimulator.cpp index 724cc99..b7b6596 100644 --- a/src/RouterSimulator.cpp +++ b/src/RouterSimulator.cpp @@ -26,8 +26,9 @@ * This version strives to stay as close as possible to the original Java and * Python code with a few differences: * - Windowing system is initialized in RouterSimulator::main - * - Events and packets need to be `delete`d from the heap since C++ does not - * have garbage collection. + * - Events and packets are `delete`d from the heap in + * RouterSimulator::runSimulation since C++ does not have garbage + * collection. * - Long option "--poison" is now called "--poisonreverse" * * Entry point: RouterSimulator::main(argc, argv) @@ -361,8 +362,7 @@ void RouterSimulator::toLayer2(RouterPacket& packet) { } void RouterSimulator::initialize(int argc, char* argv[]) { - string inputInfo = "./RouterSimulator " - "-c, --change <LINKCHANGE (bool)> " + string inputInfo = "-c, --change <LINKCHANGE (bool)> " "-n, --nodes <NODES (int)> " "-p, --poisonreverse <POISONREVERSE (bool)> " "-s, --seed <SEED (long)> " @@ -415,13 +415,13 @@ void RouterSimulator::initialize(int argc, char* argv[]) { RouterSimulator::TRACE = stoi(optarg); } break; default: { - cerr << inputInfo; + cerr << argv[0] << inputInfo; exit(EXIT_FAILURE); } break; } } } catch (invalid_argument&) { - cerr << inputInfo << endl; + cerr << argv[0] << inputInfo << endl; exit(2); } } -- GitLab