SDNSim
A software-defined network simulator in C++
Loading...
Searching...
No Matches
Device.cpp
Go to the documentation of this file.
1#include "Device.h"
2#include <iostream>
3
12Device::Device(const std::string& deviceName) : name(deviceName) {
13
14}
15
16
22std::string Device::getName() const {
23 return name;
24
25}
26
33const std::vector<std::string>& Device::getNeighbors() const {
34 return neighbors;
35}
36
43void Device::addNeighbor(const std::string& neighborName) {
44 neighbors.push_back(neighborName);
45}
46
53bool Device::isActive() const {
54 return active;
55}
56
63void Device::setActive(bool status) {
64 active = status;
65}
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
Device(const std::string &deviceName)
Constructs a Device with the given name.
Definition Device.cpp:12
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