SDNSim
A software-defined network simulator in C++
Loading...
Searching...
No Matches
Device.h
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <vector>
4
11class Device {
12private:
13 std::string name;
14 std::vector<std::string> neighbors;
15 bool active = false;
17public:
22 Device(const std::string& deviceName);
23
28 std::string getName() const;
29
34 const std::vector<std::string>& getNeighbors() const;
35
40 void addNeighbor(const std::string& neighborName);
41
46 bool isActive() const;
47
52 void setActive(bool status);
53};
Represents a network device (like a router or switch) in the SDN simulation.
Definition Device.h:11
std::string getName() const
Gets the name of the device.
Definition Device.cpp:22
bool isActive() const
Checks if the device is currently active.
Definition Device.cpp:53
void setActive(bool status)
Sets the device's active status.
Definition Device.cpp:63
void addNeighbor(const std::string &neighborName)
Adds a neighbor to this device.
Definition Device.cpp:43
const std::vector< std::string > & getNeighbors() const
Gets a reference to the list of neighbors.
Definition Device.cpp:33