Skip to content
Snippets Groups Projects
Commit 313fa15e authored by Christoffer Lundell's avatar Christoffer Lundell
Browse files

Minor improvements

parent 6046bab6
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ class RouterSimulator; ...@@ -11,7 +11,7 @@ class RouterSimulator;
class RouterNode { class RouterNode {
public: public:
RouterNode(const RouterNode&) = delete; 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(RouterNode&&) = default;
RouterNode& operator=(const RouterNode&) = delete; RouterNode& operator=(const RouterNode&) = delete;
RouterNode& operator=(RouterNode&&) = delete; RouterNode& operator=(RouterNode&&) = delete;
......
...@@ -17,7 +17,7 @@ GuiTextArea::GuiTextArea(string const& title) ...@@ -17,7 +17,7 @@ GuiTextArea::GuiTextArea(string const& title)
textedit->setFont(font); textedit->setFont(font);
textedit->setReadOnly(true); textedit->setReadOnly(true);
myGUI->setCentralWidget(textedit); myGUI->setCentralWidget(textedit);
myGUI->setFixedSize(600, 600); myGUI->setMinimumSize(600, 600);
myGUI->setWindowTitle(QString::fromStdString(title)); myGUI->setWindowTitle(QString::fromStdString(title));
myGUI->show(); myGUI->show();
} }
......
...@@ -26,8 +26,9 @@ ...@@ -26,8 +26,9 @@
* This version strives to stay as close as possible to the original Java and * This version strives to stay as close as possible to the original Java and
* Python code with a few differences: * Python code with a few differences:
* - Windowing system is initialized in RouterSimulator::main * - Windowing system is initialized in RouterSimulator::main
* - Events and packets need to be `delete`d from the heap since C++ does not * - Events and packets are `delete`d from the heap in
* have garbage collection. * RouterSimulator::runSimulation since C++ does not have garbage
* collection.
* - Long option "--poison" is now called "--poisonreverse" * - Long option "--poison" is now called "--poisonreverse"
* *
* Entry point: RouterSimulator::main(argc, argv) * Entry point: RouterSimulator::main(argc, argv)
...@@ -361,8 +362,7 @@ void RouterSimulator::toLayer2(RouterPacket& packet) { ...@@ -361,8 +362,7 @@ void RouterSimulator::toLayer2(RouterPacket& packet) {
} }
void RouterSimulator::initialize(int argc, char* argv[]) { void RouterSimulator::initialize(int argc, char* argv[]) {
string inputInfo = "./RouterSimulator " string inputInfo = "-c, --change <LINKCHANGE (bool)> "
"-c, --change <LINKCHANGE (bool)> "
"-n, --nodes <NODES (int)> " "-n, --nodes <NODES (int)> "
"-p, --poisonreverse <POISONREVERSE (bool)> " "-p, --poisonreverse <POISONREVERSE (bool)> "
"-s, --seed <SEED (long)> " "-s, --seed <SEED (long)> "
...@@ -415,13 +415,13 @@ void RouterSimulator::initialize(int argc, char* argv[]) { ...@@ -415,13 +415,13 @@ void RouterSimulator::initialize(int argc, char* argv[]) {
RouterSimulator::TRACE = stoi(optarg); RouterSimulator::TRACE = stoi(optarg);
} break; } break;
default: { default: {
cerr << inputInfo; cerr << argv[0] << inputInfo;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} break; } break;
} }
} }
} catch (invalid_argument&) { } catch (invalid_argument&) {
cerr << inputInfo << endl; cerr << argv[0] << inputInfo << endl;
exit(2); exit(2);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment